H
H
humanIvan2018-07-03 16:30:26
Node.js
humanIvan, 2018-07-03 16:30:26

How does passport.js work?

Please tell a beginner how passport.js works
5b3b79500a673527556087.png
1) Where does this user come from?
2) When serializeUzer fires, and when deserializeUser. (I made notes for myself, but I'm not entirely sure that I understood correctly)
5b3b7a33a5a18104703138.png
3) why do we include this library if we already have passport.session
4) What is the cookie age? how does it even work?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SagePtr, 2018-07-03
@humanIvan

serializeUser fires when you need to write the user into some string form (for example, write the user's id in cookies), and deserializeUser fires when this very data has been received (in our example, the id in the cookie) and you need to them to return the user back

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question