mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-30 19:03:01 +01:00
Use userwithtoken.user when authenticating with an API key
This commit is contained in:
parent
48b9116195
commit
dd1badae81
1 changed files with 2 additions and 2 deletions
|
@ -106,8 +106,8 @@ class UserAuthenticationBackend(AuthenticationBackend):
|
||||||
return AuthCredentials(["authenticated", "subscribed"]), AuthenticatedKhojUser(
|
return AuthCredentials(["authenticated", "subscribed"]), AuthenticatedKhojUser(
|
||||||
user_with_token.user
|
user_with_token.user
|
||||||
)
|
)
|
||||||
return AuthCredentials(["authenticated"]), AuthenticatedKhojUser(user)
|
return AuthCredentials(["authenticated"]), AuthenticatedKhojUser(user_with_token.user)
|
||||||
return AuthCredentials(["authenticated", "subscribed"]), AuthenticatedKhojUser(user)
|
return AuthCredentials(["authenticated", "subscribed"]), AuthenticatedKhojUser(user_with_token.user)
|
||||||
if state.anonymous_mode:
|
if state.anonymous_mode:
|
||||||
user = await self.khojuser_manager.filter(username="default").prefetch_related("subscription").afirst()
|
user = await self.khojuser_manager.filter(username="default").prefetch_related("subscription").afirst()
|
||||||
if user:
|
if user:
|
||||||
|
|
Loading…
Reference in a new issue