-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
req.login redirect is done before the user info is saved in the session #401
Comments
Yeah I've seen this same issue. There is a workaround posted in this ticket #306 Basically they suggest saving the session manually and waiting for the save callback before hitting your redirect, that is what we are now doing, but I can't say I love that solution. Anyone more familiar with the passport code know of a better way to address this? Is there a second callback or event we can listen for. Should not req.logIn wait for the session save to finish before hitting the callback? Thoughts? |
@franck34 I have the same issue too here. +1 |
Lol, issue 401 |
Still an issue for me. Cannot find a fix for it. Implementing the hack. |
I do have a similar problem of req.user not being saved properly on the redis database. The reason behind the problem is user send more than 1 requests almost at the same time to my api server, one for authentication/login and the others for retrieving data. As a result, more than 1 cookie is being set on the client side. When the client send subsequent requests to the server, the server somehow parse one of the cookies which does not contain the user info in the session store. |
I have a simple login page with local auth and custom callback.
When the login is successful, I redirect the user to the main page and check if (req.isAuthenticated()) is true.
50% of the time, req.isAuthenticated() returns false. It seems that the redirect is happening before the session information is updated. It didn't notice this issue when I was using the standard local auth options without custom callback.
Any idea ?
The text was updated successfully, but these errors were encountered: