express-4.x-local-example

Express 4.x app using Passport for authentication with username and password.

Github星跟蹤圖

todos-express-password

This app illustrates how to use Passport with
Express to sign users in with a username and password.
Use this example as a starting point for your own web applications.

Quick Start

To run this app, clone the repository and install dependencies:

$ git clone https://github.com/passport/todos-express-password.git
$ cd todos-express-password
$ npm install

Then start the server.

$ npm start

Navigate to http://localhost:3000.

Tutorial

Follow along with the step-by-step Username & Password Tutorial
to learn how this app was built.

Overview

This app illustrates how to build a todo app with sign in functionality using
Express, Passport, and the passport-local
strategy.

This app is a traditional web application, in which application logic and data
persistence resides on the server. HTML pages and forms are rendered by the
server and client-side JavaScript is not utilized (or kept to a minimum).

This app is built using the Express web framework. Data is persisted to a
SQLite database. HTML pages are rendered using EJS
templates, and are styled using vanilla CSS.

When a user first arrives at this app, they are prompted to sign in. Once
authenticated, a login session is established and maintained between the server
and the user's browser with a cookie.

After signing in, the user can view, create, and edit todo items. Interaction
occurs by clicking links and submitting forms, which trigger HTTP requests.
The browser automatically includes the cookie set during login with each of
these requests.

When the server receives a request, it authenticates the cookie and restores the
login session, thus authenticating the user. It then accesses or stores records
in the database associated with the authenticated user.

Next Steps

License

The Unlicense

Credit

Created by Jared Hanson

主要指標

概覽
名稱與所有者passport/todos-express-password
主編程語言JavaScript
編程語言JavaScript (語言數: 3)
平台
許可證The Unlicense
所有者活动
創建於2015-08-15 19:07:55
推送於2023-12-05 12:46:31
最后一次提交2023-02-25 07:07:33
發布數0
用户参与
星數896
關注者數14
派生數415
提交數189
已啟用問題?
問題數27
打開的問題數6
拉請求數4
打開的拉請求數2
關閉的拉請求數5
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?