如何使用Node.js,Express和Mongoose进行身份验证? [英] How to do authentication with Node.js, Express and Mongoose?
问题描述
我使用nodejs + express做了简单的nodejs应用程序。现在我想让用户进行身份验证。我想通过使用mongoose来实现会话处理。
你可以建议一些例子吗?
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 some example?
推荐答案
一些有用的链接:
会话管理不是由Mongoose,但通过连接mongodb或连接redis。您可以在此处查看如何在实际应用中进行用户身份验证和会话管理的示例:
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
您可以在这里找到该应用的进一步说明: http://dailyjs.com/tag/lmawa 或 http://dailyjs.com/2010/12/ 06 / node-tutorial-5 /
Further explanations for that app you can find here: http://dailyjs.com/tag/lmawa or http://dailyjs.com/2010/12/06/node-tutorial-5/
这篇关于如何使用Node.js,Express和Mongoose进行身份验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!