cargarg7 / nopassport-jwt-example

jwt auth system without using passport-jwt package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example jwt auth system

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 encryption of jwt signature
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

jwt auth system without using passport-jwt package

License:GNU General Public License v3.0


Languages

Language:JavaScript 100.0%