passport middleware, no req.login on context
See original GitHub issueHi! Thanks for this awesome package! I can’t figure out how to attach passports login to request. I do initialize it on
server.express.use(passport.initialize());
and my express req function still doesn’t have a login on it… I was wondering is there a sequence that I should have to arrange the middleware or any advice would be great! thanks
Issue Analytics
- State:
- Created 5 years ago
- Comments:6
Top Results From Across the Web
passport middleware, no req.login on context #355 - GitHub
I'm taking the authentication creds off the request and passing those into the graphql context which get passed to the resolver functions who...
Read more >Node + Express + Passport: req.user Undefined - Stack Overflow
It's successfully getting the user object, but somewhere along the middleware road, req.user is not being set (or being unset). // on successful ......
Read more >Documentation: Middleware - Passport.js
Passport is used as middleware within a web application to authenticate ... the req.user property is set to the authenticated user, a login...
Read more >Node.js Authentication Tutorial with Passport
Learn how to handle web authentication and authorization in Node using Passport.js. Create signup and login page, different types of users ...
Read more >Authenticate Users with Passport and express-session
On top of express-session and passport. So before firing up, I'm hoping you all know how to set up a basic app in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok I think I have something working here if you want to see, I am not sure how you had yours setup but I am doing a simple passport oauth with a third party service. I’m taking the authentication creds off the request and passing those into the graphql context which get passed to the resolver functions who can use them to interact with the service.
One thing to note is to make sure cookies are being sent properly from the client to the server, otherwise the auth data will not be populated on the request object.
Here is a gist of the server code that I have working:
https://gist.github.com/mjw56/5e5211b327175737b7ce1df0eadf1e01
hey guys this is no more relevant to me so I’m closing this issue. Please open a new one if you still having issues.