Fix response type of delete client tokens API endpoint

Previously the make delete API response failed, after deleting token.
Required a page refresh to see that the API token was actually gone.

This was happening because the response type of the delete token API
endpoint isn't a string, so it failed FastAPI response validation
checks.
This commit is contained in:
Debanjum Singh Solanky 2024-04-30 02:42:42 +05:30
parent 0f4c3518d3
commit e6da0f9a8c

View file

@ -86,7 +86,7 @@ def get_tokens(request: Request):
@auth_router.delete("/token")
@requires(["authenticated"], redirect="login_page")
async def delete_token(request: Request, token: str) -> str:
async def delete_token(request: Request, token: str):
"Delete API token for given user"
return await delete_khoj_token(user=request.user.object, token=token)