docs: documented /account/auth and fixed the Auth header in /account/register

This commit is contained in:
antifallobst 2024-03-24 16:26:50 +01:00
parent 3ac7716826
commit eb877b0943
Signed by: antifallobst
GPG Key ID: 2B4F402172791BAF
2 changed files with 26 additions and 1 deletions

View File

@ -0,0 +1,25 @@
# `/account/auth`
**Type:** POST
**Auth:** No
**Body:** JSON
## Description
This endpoint generates a bearer auth token, which can then be used to access endpoints, that need auth.
The generated token expires after 2 weeks.
## Request Body
| Field | Description |
|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `userid` | The users primary id (the one that is returned from [`/account/register`](https://git.nerdcult.net/antifallobst/icrc-server/src/branch/master/docs/api/endpoints/account/register.md) |
| `password` | The password of the account. |
## Responses
| HTTP Code | Type | Description | Body |
|-----------|-----------------------------|-------------------------------------------------------------------|------------------------------------------------------------------|
| 200 | Success | Successful authentication. | Json containing only a `token` field, containing a bearer token. |
| 401 | Error/AuthenticationFailure | There was no authentication possible using the given credentials. | Standard Error Body. |
| 404 | Error/UserNotFound | There was no user found for the given ID. | Standard Error Body. |

View File

@ -1,7 +1,7 @@
# `/account/register`
**Type:** POST
**Auth:** Yes
**Auth:** No
**Body:** JSON
## Description