I have implemented passport-local strategy and passport-bearer strategy.
When user logins with username/password credentials, I generate JSON Web Token which returns to requester. On each request I get access_token
from query, decode this token from JWT to object and make bearer authorization implemented in /api/policies
. And all auth works fine.
But when I provide this access_token
to RESTful route i.e. user
I got empty array.
The problem, that Sails accepts access_token
as criteria.
Example:
GET /user ## Forbidden
GET /user?access_token=<token> ## Empty array
How can I disable or fix it?