Can't retrieve the current user from access token.
Bug or feature request
- [x] Bug
- [ ] Feature request
Description of feature (or steps to reproduce if bug)
I have a middle-ware that I want to check some logic on the current user, bellow is my code:
As I see there is a relation from AccessToken model to User model:

Expected result
Can get full instance of current user successfully.
Actual result (if bug)
But I got the error :

Additional information (Node.js version, LoopBack version, etc)
loopback 2.x
@bajtos Can you please look at this, thanks!
@dongmai thank you for reporting the bug. Could you please create a small app reproducing the issue? See http://loopback.io/doc/en/contrib/Reporting-issues.html#bug-report for more details.
BTW req.accessToken is already an instance of AccessToken, no need to call findById again.
@dongmai , have you tried including "user" relation ?
Try this
app.models.AccessToken.findById(req.accessToken, {"include":"user"}, cb);
@padelagani , It doesn't work. @bajtos Seems it only happens for loopback-connector-mssql
@dongmai good to know! Could you please create a small app reproducing the problem, as I mentioned in my last comment?
@0candy @loay could you PTAL?
@dongmai Are you still encountering this issue? If so, could you please provide a sample app for us to reproduce? Thanks!
Closing due to inactivity. If you are still running into problems, feel free to leave a comment and I will reopen the issue.