docs: update admin and user http api documentation
This commit is contained in:
@@ -478,3 +478,75 @@ Content-Type: application/json
|
||||
|
||||
{"message":"Dashboard unstarred"}
|
||||
```
|
||||
|
||||
## Auth tokens of the actual User
|
||||
|
||||
`GET /api/user/auth-tokens`
|
||||
|
||||
Return a list of all auth tokens (devices) that the actual user currently have logged in from.
|
||||
|
||||
**Example Request**:
|
||||
|
||||
```http
|
||||
GET /api/user/auth-tokens HTTP/1.1
|
||||
Accept: application/json
|
||||
Content-Type: application/json
|
||||
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
||||
```
|
||||
|
||||
**Example Response**:
|
||||
|
||||
```http
|
||||
HTTP/1.1 200
|
||||
Content-Type: application/json
|
||||
|
||||
[
|
||||
{
|
||||
"id": 361,
|
||||
"isActive": true,
|
||||
"clientIp": "127.0.0.1",
|
||||
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36",
|
||||
"createdAt": "2019-03-05T21:22:54+01:00",
|
||||
"seenAt": "2019-03-06T19:41:06+01:00"
|
||||
},
|
||||
{
|
||||
"id": 364,
|
||||
"isActive": false,
|
||||
"clientIp": "127.0.0.1",
|
||||
"userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",
|
||||
"createdAt": "2019-03-06T19:41:19+01:00",
|
||||
"seenAt": "2019-03-06T19:41:21+01:00"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
## Revoke an auth token of the actual User
|
||||
|
||||
`POST /api/user/revoke-auth-token`
|
||||
|
||||
Revokes the given auth token (device) for the actual user. User of issued auth token (device) will no longer be logged in
|
||||
and will be required to authenticate again upon next activity.
|
||||
|
||||
**Example Request**:
|
||||
|
||||
```http
|
||||
POST /api/user/revoke-auth-token HTTP/1.1
|
||||
Accept: application/json
|
||||
Content-Type: application/json
|
||||
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
||||
|
||||
{
|
||||
"authTokenId": 364
|
||||
}
|
||||
```
|
||||
|
||||
**Example Response**:
|
||||
|
||||
```http
|
||||
HTTP/1.1 200
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"message": "User auth token revoked"
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user