This is a NodeJS app that implements a basic username and password authentication with JWT
POST /auth/register || /auth/login
The body must have:
- username: The username
- password: The password
- confirm-password: The password confirmation
The body must have:
- username: The username
- password: The password
GET /posts || /users
: for testing purpose
The headers must have:
- Authorization: bearer user_token
The headers must have:
- Authorization: bearer user_token
You must install node.js in your machine
Clone the repository, run npm install and then run the server:
-
on development mode :
npm run dev
-
on production mode :
npm run start
You can change the PORT or the ACCESS_TOKEN_SECRET on /config/.env
/requests.rest
file
The Collaboration Platform for API Development, it provides a powerful GUI platform to make your API development faster & easier
- Hamza Ghenimi - JWT-Authentication