https://github.com/relativelie/auth_back
https://github.com/relativelie/auth_back
Last synced: 25 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/relativelie/auth_back
- Owner: Relativelie
- Created: 2024-01-21T22:47:25.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-22T11:14:19.000Z (over 2 years ago)
- Last Synced: 2025-03-21T09:22:58.868Z (about 1 year ago)
- Language: JavaScript
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mocks for auth page
This project serves as a mock data repository for a frontend project with [authentication](https://github.com/Relativelie/auth).
## Requests
### Registration:
- Method: POST
- Path: /api/register
- Request Body: {email: string, password: string}
- Response:
200 OK status. Body:
access_token: string,
refresh_token: string,
expires_in: number,
refresh_expires_in: number,
all another - error status
### Login:
- Method: POST
- Path: /api/login
- Request Body: {email: string, password: string}
- Response:
200 OK status.
Body:
{
access_token: string,
refresh_token: string,
expires_in: number,
refresh_expires_in: number,
}
all another - error status
### Refresh
- Method: GET
- Path: /api/refresh
- Response:
200 OK status.
Body:
{
access_token: string;
expires_in: number;
refresh_expires_in: number;
refresh_token: string;
}
all another - error status
### Profile
- Method: GET
- Path: /api/profile
- Response:
200 OK status.
Body:
{
name: string;
job: string;
email: string;
location: string;
interests: string[];
bio: string;
avatar: string;
}
401, error: Invalid token
## Installation
1. Clone the repository
https://github.com/Relativelie/auth_back.git
2. Navigate to the project directory
3. Install packages with 'npm install'
4. Start the development server ''node auth_mock.js'