Skip to content
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

passport.deserializeUser called multiple times #11

Closed
ghost opened this issue Jun 22, 2012 · 3 comments
Closed

passport.deserializeUser called multiple times #11

ghost opened this issue Jun 22, 2012 · 3 comments

Comments

@ghost
Copy link

ghost commented Jun 22, 2012

I'm new to passport and just ran the login example on my local machine.
When I log in as 'bob', password.serializeUser and password.deserializeUser are called.
Thats fine, but why is password.deserializeUser called two times?
How can I cache the user, so I don't have pull him from the db every time password.deserializeUser is called.

@jaredhanson
Copy link
Owner

See Issue #14 on passport, and specifically this comment for the solution.

@meetDeveloper
Copy link

@jaredhanson serializeUser should only be called once right, when user is authenticated???

@K1Z4
Copy link

K1Z4 commented Jan 27, 2018

When I was debugging multiple deserializeUser calls I found that my issue was chrome requesting source map files which did not exist. These calls resulted in 404 pages which would deserialize the user
for the header links.

These requests did not show up in the chrome network tab which made things more confusing.

The following debugging steps helped me uncover the issue:
jaredhanson/passport#83 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants