From dd1badae81f336cd79d7faea1056ea2505d87b99 Mon Sep 17 00:00:00 2001 From: sabaimran Date: Fri, 24 Nov 2023 22:18:45 -0800 Subject: [PATCH] Use userwithtoken.user when authenticating with an API key --- src/khoj/configure.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/khoj/configure.py b/src/khoj/configure.py index 022f1395..6aa747e8 100644 --- a/src/khoj/configure.py +++ b/src/khoj/configure.py @@ -106,8 +106,8 @@ class UserAuthenticationBackend(AuthenticationBackend): return AuthCredentials(["authenticated", "subscribed"]), AuthenticatedKhojUser( user_with_token.user ) - return AuthCredentials(["authenticated"]), AuthenticatedKhojUser(user) - return AuthCredentials(["authenticated", "subscribed"]), AuthenticatedKhojUser(user) + return AuthCredentials(["authenticated"]), AuthenticatedKhojUser(user_with_token.user) + return AuthCredentials(["authenticated", "subscribed"]), AuthenticatedKhojUser(user_with_token.user) if state.anonymous_mode: user = await self.khojuser_manager.filter(username="default").prefetch_related("subscription").afirst() if user: