It's an auth app generating JWT access and refresh tokens. It also storages users and has token's black list.
POST /signup
- registration by email, name and password
body:
{
email: string;
password: string
}
response:
{
accessToken: string;
}
POST /login
- login by email and password
body:
{
email: string;
password: string
}
response:
{
accessToken: string;
}
POST /update_access
- renew access token and refresh token if it's expired
It requires cookie (with credentials) and header Authorization: Bearer <ACCESS_TOKEN>
response:
{
accessToken: string;
}
GET /private/user
- get current user
It requires header Authorization: Bearer <ACCESS_TOKEN>
response:
{
id: string;
email: string;
name: string;
}
GET /private/user/:id
- get user by ID
It requires header Authorization: Bearer <ACCESS_TOKEN>
response:
{
id: string;
email: string;
name: string;
}
-1
- Private error: Request parameters are incorrent
0
- Unextected error
1
- User already exists
2
- User with this email and password doesn't exist
3
- Access or refresh token is invalid
4
- Access token is expired (needed to refresh)
5
- Refresh token was blocked (need to login again)
There will be a description about building and starting