如何使用Node.js,Express和Mongoose进行身份验证? [英] How to do authentication with Node.js, Express and Mongoose?

查看:135
本文介绍了如何使用Node.js,Express和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?

推荐答案

一些有用的链接:

如何在节点中实现登录身份验证。 js

在node.js和mongodb中创建注册和登录表单

会话管理不是由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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆