Skip to content

AndoniAT/Auth_JWT_NodeJs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Auth_JWT_NodeJs

Implementing authentication and JWT in node js.

Start Node.js project :

npm init

Setting eslint config :

npm init @eslint/config

eslint.config.mjs has been generated

See eslint page for more information.

Install Eslint & Error Lens packages in VS Code to highlighting of errors in files.

Nodemon package has been include for running dev environnment :

npm i --save-dev nodemon

To run it, please use :

npm run devStart

Another packages installed :

  • bcrypt : To hash and compare paswords.
  • jsonwebtoken : To generate and compare token between server & client.

To generate our ACCESS_TOKEN_SECRET :

node require('crypto').randomBytes(64).toString('hex')

copy this string to the ACCESS_TOKEN_SECRET key in your .env Do it again and put the value in REFRESH_TOKEN_SECRET key


Author: Andoni ALONSO TORT

About

Implementing authentication and JWT in node js.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published