Rework authentication

This commit is contained in:
Aslan 2026-01-01 17:07:12 +01:00
parent f736171db8
commit a8ede76571
2 changed files with 17 additions and 6 deletions

View file

@ -1 +1 @@
0.3.4
0.3.5

View file

@ -30,8 +30,6 @@ Registers a new user
}
```
---
## POST /api/v1/auth/login
### Request:
@ -43,15 +41,14 @@ Registers a new user
}
```
Logs in a user and returns a new session
Logs in a user and returns a new session cookie
### Response (success):
```json
{
"id": "string",
"ownerId": "string",
"token": "string"
"ownerId": "string"
}
```
@ -63,3 +60,17 @@ Logs in a user and returns a new session
"error": "incorrect credentials"
}
```
## GET /api/v1/auth/refresh
Creates and returns an authorization token for the current session using session cookie
### Response (success):
```json
{
"id": "string",
"ownerId": "string",
"token": "string"
}
```