You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to access the current user from a model method #816
@jankcat Thank you for looking into context issue and providing the sample code.
While the link you post is from our old doc site. Now it's migrated to new site and please check latest doc of proper usage of context: http://loopback.io/doc/en/lb2/Using-current-context.html
It elaborates some warning, solution, ect....
Activity
jannyHou commentedon Dec 3, 2015
hey @bajtos , I confirmed with Rand and this solution is already explained perfectly in doc:
https://docs.strongloop.com/display/public/LB/Using+current+context#Usingcurrentcontext-Usecurrentauthenticateduserinremotemethods
The same example snippet as you post in comment is applied.
Since it's done, I will close it here. Thanks.
bajtos commentedon Dec 4, 2015
👍
jankcat commentedon Nov 2, 2016
For those looking for a solution to finding out the authenticated user in a remote method (now that currentContext is deprecated), the groundwork is laid out at the following link: http://loopback.io/doc/en/lb2/Remote-methods.html#http-mapping-of-input-arguments
Here is my example snippet:
jannyHou commentedon Nov 2, 2016
@jankcat Thank you for looking into
contextissue and providing the sample code.While the link you post is from our old doc site. Now it's migrated to new site and please check latest doc of proper usage of
context:http://loopback.io/doc/en/lb2/Using-current-context.html
It elaborates some warning, solution, ect....
jankcat commentedon Nov 2, 2016
Thanks, I updated my comment to the new documentation location.