Node.js / Express密码保护页 [英] Node.js/Express Password Protected Page
问题描述
我是新到node.js / express!
在我的情况下,我有一个聊天网站和一个聊天管理站点。
当我进入_____:3000 / admin时,它要求在表格中输入密码。
现在如何检查密码是否是正确的密码,而不是在客户端的java脚本中?
我试图远离php,因为它太混乱了......
我该怎么做,然后发送一个用户无法访问的html文件?
这不像其他问题,因为我不想要/需要'用户名'
您可以使用护照模块进行本地身份验证。使用哈希密码保存用户数据库,使用bcrypt模块。
I'm new to node.js/express!
In my case I have a chat site and a chat admin site. When I go in _____:3000/admin, it asks for a password in a form. Now how would I check if the password is the correct password, not in the client's java-script? I'm trying to stay away from php, because its too confusing... How would I do that and then send a html file which can not be accessed by the user?
This is not like the other questions because I DON'T want/need 'usernames'
You can use Passport module for local authentication.Keep a database of users with hashed passwords, using bcrypt module.
这篇关于Node.js / Express密码保护页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!