You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Call it for authentication:
passport.authenticate( 'thestrategy' )
All strategies conform to this pattern. ...all except the built in session strategy. I advice that you change the api of the built in session strategy to conform to this convention as well. This would lead to simpler api, and less time for newbies to adapt.
Instead of :
app.use( passport.session() )
Do this:
app.use( passport.authenticate('session') )
Instead of:
passport.serializeUser(...) and
passport.deserializeUser(...)
Do this:
passport.use( new SessionStrategy( serializer, deserializer))
This discussion was converted from issue #736 on June 18, 2021 23:57.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
All passport strategies follow the same pattern:
passport.use ( new Whatever.Strategy( params) )
passport.authenticate( 'thestrategy' )
All strategies conform to this pattern. ...all except the built in session strategy. I advice that you change the api of the built in session strategy to conform to this convention as well. This would lead to simpler api, and less time for newbies to adapt.
Instead of :
app.use( passport.session() )
Do this:
app.use( passport.authenticate('session') )
Instead of:
passport.serializeUser(...) and
passport.deserializeUser(...)
Do this:
passport.use( new SessionStrategy( serializer, deserializer))
Beta Was this translation helpful? Give feedback.
All reactions