Migrated to ES Modules and req.user is always returning undefined #893
Unanswered
nicholasoxford
asked this question in
Help
Replies: 0 comments
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.
Uh oh!
There was an error while loading. Please reload this page.
Hey there 👋, as the title states, I had a very fun Friday and migrated our typescript repo over to ES2020.
After I fixed the obvious require issues, I immediately got the error
Unknown authentication strategy "jwt". I then converted the passport code to export default the passport.use() function. The error went away, but I havent been able to use my auth strategy since then.req.user is always returning undefined. IF you can think of other improvements im all ears lol
New code below
passport-config.ts:
server.ts
some package.json info
Example request
All reactions