From e6da0f9a8c5c92d5b95f56cfd7f0208fcc08adc4 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Tue, 30 Apr 2024 02:42:42 +0530 Subject: [PATCH] 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. --- src/khoj/routers/auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/khoj/routers/auth.py b/src/khoj/routers/auth.py index 32a3f845..199ccd2b 100644 --- a/src/khoj/routers/auth.py +++ b/src/khoj/routers/auth.py @@ -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)