pinakes/docs/api/auth.md
NotAShelf 9e5eb41d39
nix: set up project-wide formatter
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I4806c58aa0a17f504c9312723ad770166a6a6964
2026-03-22 23:58:28 +03:00

101 lines
1.9 KiB
Markdown
Vendored

# Auth
Authentication and session management
## Endpoints
### POST /api/v1/auth/login
**Authentication:** Not required
#### Request Body
`Content-Type: application/json`
See `docs/api/openapi.json` for the full schema.
#### Responses
| Status | Description |
| ------ | --------------------- |
| 200 | Login successful |
| 400 | Bad request |
| 401 | Invalid credentials |
| 500 | Internal server error |
---
### POST /api/v1/auth/logout
**Authentication:** Required (Bearer JWT)
#### Responses
| Status | Description |
| ------ | --------------------- |
| 200 | Logged out |
| 401 | Unauthorized |
| 500 | Internal server error |
---
### GET /api/v1/auth/me
**Authentication:** Required (Bearer JWT)
#### Responses
| Status | Description |
| ------ | --------------------- |
| 200 | Current user info |
| 401 | Unauthorized |
| 500 | Internal server error |
---
### POST /api/v1/auth/refresh
Refresh the current session, extending its expiry by the configured duration.
**Authentication:** Required (Bearer JWT)
#### Responses
| Status | Description |
| ------ | --------------------- |
| 200 | Session refreshed |
| 401 | Unauthorized |
| 500 | Internal server error |
---
### POST /api/v1/auth/revoke-all
Revoke all sessions for the current user
**Authentication:** Required (Bearer JWT)
#### Responses
| Status | Description |
| ------ | --------------------- |
| 200 | All sessions revoked |
| 401 | Unauthorized |
| 500 | Internal server error |
---
### GET /api/v1/auth/sessions
**Authentication:** Required (Bearer JWT)
#### Responses
| Status | Description |
| ------ | --------------------- |
| 200 | Active sessions |
| 401 | Unauthorized |
| 403 | Forbidden |
| 500 | Internal server error |
---