A Fake REST API using json-server with JWT authentication.
Implemented End-points: login, register
$ npm install
$ npm run start-auth
Might need to run
npm audit fix
You can login/register by sending a POST request to
POST http://localhost:3001/auth/login
POST http://localhost:3001/auth/register
with the following data
{
"email": "admin@mail.com",
"password":"password"
}
You should receive an access token with the following format
{
"accessToken": "<ACCESS_TOKEN>"
}
You should send this authorization with any request to the protected endpoints
Authorization: Bearer <ACCESS_TOKEN>
Check out these tutorials: