Rework authentication
This commit is contained in:
parent
f736171db8
commit
a8ede76571
2 changed files with 17 additions and 6 deletions
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
||||||
0.3.4
|
0.3.5
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,6 @@ Registers a new user
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## POST /api/v1/auth/login
|
## POST /api/v1/auth/login
|
||||||
|
|
||||||
### Request:
|
### 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):
|
### Response (success):
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "string",
|
"id": "string",
|
||||||
"ownerId": "string",
|
"ownerId": "string"
|
||||||
"token": "string"
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -63,3 +60,17 @@ Logs in a user and returns a new session
|
||||||
"error": "incorrect credentials"
|
"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"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue