-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MongoDB - loopback.getCurrentContext() return null #2519
Comments
Thank you for pointing out this issue. Due to the instability, there are plans to deprecate this method. |
I had same problem, so I use [email protected] . It work fine. |
Hey, I've run across this issue as well and just wanted to add some extra info (hope it helps somewhere). I had quick look through #1676 and didnt see anything that might help me. I initially had an earlier version of loopback running, where I had no problems calling loopback.getCurrentContext() from within a remote method. I inadvertently updated to the current version, and started seeing issues. I have created a demo repo (from scratch and using slc commands + customisation) to help explain. https://github.com/beornharris/authtest The issue I am experiencing is directly related to MongoDB and access tokens, as far as I can tell. Using the repo, the steps to replicate (in api explorer) are as follows (note: requires mongo instance) :
`{ "email": "[email protected]", "password": "user1"} and set the Access Token.
Given this, I have a few other observations :
EDIT: @syuhei176 - I can confirm that the issue disappears with [email protected] |
Just try to use |
@dongmai - just to confirm, to downgrade the mongo connector you did something like the following...
so it is using 1.15.1, and not minimum 1.15.1 ? |
I had the same issue using the same connector. |
@beornharris Yes, I've downgraded the version number in package json and re-run Before downgrading it was working on local but not on remote server, and its the same after downgrading. |
Strange, after downgrading version i try use @josieusa @bajtos |
@beornharris I reproduced the issue using your |
@josieusa try telling MongoDB to use cls-bluebird instead and then use In |
Issue moved to strongloop/loopback-context #21 via ZenHub |
Hi everyone ,
Sorry for duplication, but I'm facing it again on nearly the latest version of loopback.
Here is my
pacakge.json
I've used a middleware to save current logged user data into context but it (
getCurrentContext
) always returnednull
when working with MongoDB (memory db works just fine.)Bellow is my code,
Can anyone please have a look ? Have I done something wrong ?
Thanks.
The text was updated successfully, but these errors were encountered: