req.user is undefined #88
Unanswered
ricardonogues
asked this question in
Q&A
Replies: 1 comment
-
Have you set up the deserializer? Something like: passport.deserializeUser((id, cb) =>
process.nextTick(async () => {
const user = await User.findById(id).exec()
cb(null, user : null)
})
) Have you set up your context for your operations? Are you using |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm using this package to manage sessions with a PGSQL database. The login works fine and the user is correctly serialized to the DB. The problem seems to happen with getting the current user because req.user is undefined. Where is req.user being set? Is it something I have to do?
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions