docs: documented /account/auth and fixed the Auth header in /account/register
This commit is contained in:
parent
3ac7716826
commit
eb877b0943
|
@ -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. |
|
|
@ -1,7 +1,7 @@
|
|||
# `/account/register`
|
||||
|
||||
**Type:** POST
|
||||
**Auth:** Yes
|
||||
**Auth:** No
|
||||
**Body:** JSON
|
||||
|
||||
## Description
|
||||
|
|
Loading…
Reference in New Issue