Open Brainshack opened 8 years ago
I can confirm I am having the same problem. Did you ever figure out the issue?
It appears to me that the UserController's "me" action isn't being called for some reason, even if you route it directly. I've tried calling "sails.log.info()" in the "me" action, and nothing is being logged. I've also tried editing the response passed in to res.ok(), and that didn't change anything either.
Got the same problem =/
I found a solution! Use this: https://github.com/langateam/sails-permissions
Just use the files from sails-permission code! I had problems using sails-auth only, but now everything works like charm :)
(even /user/me) ;)
+1
In my case, deserializeUser
is never called. So the user object is not attached to req.user
.
Adding the passport
policy for UserController
in config/policies.js
will invoke deserializeUser
, and the user will then be attached, but I'm not sure whether if this is the right way to do it.
In config/policies.js
:
UserController: {
me: ['passport']
}
Hello,
I have setup a brand new sails app with sails auth. I am using the local strategy. I create a User as described in the docs and authenticated using /auth/local. The auth call returns the correct user. However, when I call /user/me afterwards, the result is empty. I am using Postman to make the calls. A Cookie with the session id exists, so I suppose there maybe needs to be something else setup? I get the same error, when I try using the socket api from the browser,