Skip to content

zxcv1884/node-js-jwt-auth-sqlite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js – JWT Authentication & Authorization with JSONWebToken & Sequelize using SQLite

Reference:

Node.js JWT Authentication & Authorization example

Project setup

npm install

Run

npm start

API

Sign Up

Example (POST) : http://127.0.0.1:4000/api/auth/signup

{
	"username":"admin",
	"password":"admin"
}

Sign In

Example (POST) : http://127.0.0.1:4000/api/auth/signin

{
	"username":"admin",
	"password":"admin"
}

Change Password

Example (POST) : http://127.0.0.1:4000/api/auth/changePassword

{
	"username":"admin",
	"password":"admin",
	"newPassword" : "user"
}

Confirm token validity

Example (POST) : http://127.0.0.1:4000/api/auth/auth

{
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiaWF0IjoxNTg1MTIwNzg5LCJleHAiOjE1ODUyMDcxODl9.vRh2qorgcNvN7Tqnu5d1G167j22vwnrZIFxr2i0Xsj8"
}

Releases

No releases published

Packages

No packages published