How to do authentication with Node.js, Express and Mongoose?

前端 未结 3 543
遇见更好的自我
遇见更好的自我 2020-12-22 15:35

I\'ve made simple nodejs application by using nodejs+express. Now I want to make user authentification. I want to realize session handling by using mongoose. Can you advise

3条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-22 16:18

    Some useful links:

    how to implement login auth in node.js

    creating registration and login form in node.js and mongodb

    Also session management isn't done by Mongoose, but by connect-mongodb or connect-redis. You can checkout an example on how to do user auth and session management in a real application here:

    https://github.com/alexyoung/nodepad/blob/master/app.js

    Further explanations for that app you can find here: http://dailyjs.com/tag/lmawa or http://dailyjs.com/2010/12/06/node-tutorial-5/

提交回复
热议问题