-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Fix : Session token issue #373
Conversation
In _User collection a field _session_token is present and if you fetch the user data form server, this field override the sessionToken saved in your browser. If you don't fetch the user, all request to server contain the right sessionToken and if you fetch the user data from the server, all next requests will contain the wrong sessionToken come form the _session_token in user data fetched.
Yeah this makes sense, for older migrated users, who used to have non-expiring session tokens. Can you add a test which fetches the user and ensures the session token hasn't changed? |
@flessard updated the pull request. |
@gfosco I add test, but i am not sur if i do the right way. Never done before :) |
The test looks good.. Can you rebase now? |
# Conflicts: # src/users.js
@flessard updated the pull request. |
Thanks! 👍 |
Hello |
@absolutlabs i just try whit a unit-test and everting work perfect. Did you run on 2.0.8 ? |
Yep, we deleted the app on Heroku and created a new one. On the logs it says :
... and we were still facing the same issue. On our tests, we found that everything works perfectly if I sign on with a new FB user. We found that, if we compare both _User documents, the old one has more properties : Old user :
With a freshly created user, we got :
There is no After FB login with the old user, PFSession function
Just after fetching the user, the user session token changes to ai31jKTlpIpC90PH0zhqFVljz (ie the And as soon as I delete the _session_token key in the old user's document, everything works fine : the session token doesn't change after fetching a user. weird :/ Should we update every document in our _User collection on mongolab and delete the |
@absolutlabs 2.0.8 don't include last PR fix some issues whit the sessionToken. You need to wait for 2.0.9. |
everything works well with 2.1.2, problem is solved. thanks ! |
In _User collection a field _session_token is present and if you fetch
the user data form server, this field override the sessionToken saved
in your browser.
If you don't fetch the user, all request to server contain the right
sessionToken and if you fetch the user data from the server, all next
requests will contain the wrong sessionToken come form the
_session_token in user data fetched.