Advicing to change of API of built in session strategy #825
DenizBasgoren
started this conversation in
Ideas
Replies: 0 comments
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.
Uh oh!
There was an error while loading. Please reload this page.
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))
All reactions