What does passport.session() middleware do?

前端 未结 4 1696
小鲜肉
小鲜肉 2020-12-04 05:58

I am building an authentication system using Passport.js using Easy Node Authentication: Setup and Local tutorial.

I am confused about what passport.session()<

4条回答
  •  长情又很酷
    2020-12-04 06:11

    It simply authenticates the session (which is populated by express.session()). It is equivalent to:

    passport.authenticate('session');
    

    as can be seen in the code here:

    https://github.com/jaredhanson/passport/blob/42ff63c/lib/authenticator.js#L233

提交回复
热议问题