-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c3d9070
commit 8918b21
Showing
1 changed file
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,51 @@ | ||
# node-authentication-session | ||
# NodeJs Basic Auth using Session | ||
|
||
|
||
|
||
NodeJs Basic auth which covers brief introduction of the following: | ||
|
||
- bcryptjs [to hash password] | ||
- mongoose [database model] | ||
- client-sessions [to manage session] | ||
- express-session [to manage session] | ||
- csurf [to manage csrf token] | ||
|
||
# New Features! | ||
|
||
- Hashing password using bcryptjs | ||
- Using session middleware | ||
- Using csrf token to validate the form | ||
|
||
|
||
We can also use other module to manage session: | ||
- https://www.npmjs.com/package/cookie-session | ||
- https://www.npmjs.com/package/client-session | ||
- https://www.npmjs.com/package/cookie-parser | ||
|
||
|
||
### Tech | ||
|
||
This repo uses number of packages/modules: | ||
|
||
* [https://www.npmjs.com/package/bcryptjs] - bcryptjs | ||
* [https://www.npmjs.com/package/body-parser] - body-parser | ||
* [https://www.npmjs.com/package/client-sessions] - client-sessions | ||
* [https://github.com/expressjs/csurf] - csurf | ||
* [https://www.npmjs.com/package/ejs] - ejs | ||
* [https://www.npmjs.com/package/express] - express | ||
* [https://www.npmjs.com/package/express-sessions] - express-session | ||
* [https://www.npmjs.com/package/mongoose] - mongoose | ||
|
||
|
||
### Installation | ||
|
||
It requires [Node.js](https://nodejs.org/) v7+ to run. | ||
|
||
Install the dependencies and devDependencies and start the server. | ||
|
||
```sh | ||
$ cd basicAuth | ||
$ npm install | ||
$ npm start | ||
``` | ||
|