How does the auth middleware work? #222
Unanswered
dev-mirzabicer
asked this question in
Q&A
Replies: 1 comment
-
You can find your answer with checking ./src/config/passport.js Ln 17, Col 5. There is we set const user = User.findById(......), |
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.
-
I've been inspecting the code and I'm stuck at the auth middleware. I understand the most of it, but I don't understand the part where passport "provides" the user (at the line
req.user = user
in the verification function's returned function). What is the type of the "user" parameter? Is it a string or is it a mongoose User document?Beta Was this translation helpful? Give feedback.
All reactions