Full Authentication & Authorization using nodejs, bcrypt, jsonwebtoken, and pg that integrates accessToken, and refresh token in an advanced way
| keys | ||
| migrations | ||
| spec/support | ||
| sql | ||
| src | ||
| .env | ||
| .eslintrc.js | ||
| .gitignore | ||
| .prettierrc.json | ||
| database.json | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| yarn.lock | ||
Nodejs-Refresh-Token
Description
Full Authentication & Authorization using nodejs, bcrypt, jsonwebtoken, pg thats integrate accessToken, refreshToken with advanced way
Dependencies
-
Node v14.15.1 (LTS) or more recent. While older versions can work it is advisable to keep node to latest LTS version
-
npm 6.14.8 (LTS) or more recent, Yarn can work but was not tested for this project
Installation
Database setup
- Open postgres terminal with:
psql postgres
1- CREATE DATABASE authentication;
2- CREATE ROLE admin WITH PASSWORD 'admin';
3- ALTER ROLE admin WITH SUPERUSER CREATEROLE CREATEDB LOGIN;
4- GRANT ALL PRIVILEGES ON DATABASE authentication TO admin;
- Second to install the node_modules run
npm installoryarn. After installation is done start the api in dev mode withnpm run devoryarn dev.
Unit Tests
No Unit test available now.
Built With
- Node - Javascript Runtime
- Express - Javascript API Framework
- PostgreSQL - Open Source Relational Database