cargarg7 / passport-jwt-example

passport-jwt example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example of use of passport-jwt

First of all you must create .env file with these variables:

MONGO_URI=mongodb+srv://user:password@server/db

# secret for encryption of jwt signature
JWT_SECRET=yoursecret

# number of rounds for Blowfish algorithm for hashing user password
BCRYPT_ROUNDS=12

# lifetime of the token (in seconds)
JWT_LIFETIME=86400

# algorithm used in token signing
JWT_ALGORITHM=HS256

# server port
PORT=8080

You can create use a mongodb server at mongodb Atlas service for free.

Install

About

passport-jwt example

License:GNU General Public License v3.0


Languages

Language:JavaScript 100.0%