Giter Site home page Giter Site logo

simple_login's Introduction

node-express | 实现登录验证和授权

账号登录验证和权限设置,可以说是任何一个系统都必须具备的基本功能,而方式是从最传统的账号密码登录,到社交账号绑定不等。

1、登录验证(Authentication)

先要考虑登录有什么用?

最基本的目的是为了让系统在很多人中认得你,你上次来干什么了,做到哪一步了,一句话概括是:记得之前的你。

另外的目的是为了不让其他人冒充你。概括为:确保真的是你。

以上两个目的的实现需要两个中间件处理。

会话(session) ---> 记得之前的你

Passport ---> 确保真的是你

2、授权(Authorization)

登录验证是为了验证你的身份,有机会进入系统的大门。而授权是为了确定做的操作,都是被允许的,你有被赋予权限。系统需要知道你是普通用户,还是论坛坛主,又或者是整个系统的管理员。

Authorization

运行部署:

1、数据库用户名、密码、数据库名都是test,clone下来后要先建立一个数据库,或者修改连接数据库。

2、npm install //安装依赖

3、npm start //启动项目

🙏 🙏 🙏 🙏 🙏 🙏 🙏 🙏 🙏 🙏 🙏 🙏 🙏 感觉不错,star一下,谢谢啦! 🙏 🙏 🙏🙏 🙏 🙏 🙏 🙏 🙏 🙏 🙏 🙏 🙏

simple_login's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.