According to this question, user data should live on res.locals.user
but in Passport.js examples, this data is put on req.user
.
Why did Passport.js not follow the res.locals
convention?
According to this question, user data should live on res.locals.user
but in Passport.js examples, this data is put on req.user
.
Why did Passport.js not follow the res.locals
convention?
req.local is just a place where user email and password is store.You can store it any other variable name also.
Basically passport manage things, you can customize all these things as per your requirement. People follow this structure due to : local :{name ,password} google :{token,refresh}, fb..... and so on so its easy to search during login