Fix API auth crash and add more error messages

This commit is contained in:
rubenwardy
2020-05-19 17:24:57 +01:00
parent 8484c0f0aa
commit a36e233051
4 changed files with 16 additions and 11 deletions

View File

@@ -9,6 +9,8 @@ Authentication is done using Bearer tokens:
You can use the `/api/whoami` to check authentication.
Tokens can be attained by visiting "API Tokens" on your profile page.
## Endpoints
### Misc
@@ -16,7 +18,7 @@ You can use the `/api/whoami` to check authentication.
* GET `/api/whoami/` - Json dictionary with the following keys:
* `is_authenticated` - True on successful API authentication
* `username` - Username of the user authenticated as, null otherwise.
* 403 will be thrown on unsupported authentication type, invalid access token, or other errors.
* 4xx status codes will be thrown on unsupported authentication type, invalid access token, or other errors.
### Packages