Fix to use user rather than user_with_token in authenticated credentials

This commit is contained in:
sabaimran 2023-11-24 22:18:00 -08:00
parent 771f9bcfa1
commit 48b9116195

View file

@ -82,9 +82,7 @@ class UserAuthenticationBackend(AuthenticationBackend):
or subscription_state == SubscriptionState.TRIAL.value
)
if subscribed:
return AuthCredentials(["authenticated", "subscribed"]), AuthenticatedKhojUser(
user_with_token.user
)
return AuthCredentials(["authenticated", "subscribed"]), AuthenticatedKhojUser(user)
return AuthCredentials(["authenticated"]), AuthenticatedKhojUser(user)
return AuthCredentials(["authenticated", "subscribed"]), AuthenticatedKhojUser(user)
if len(request.headers.get("Authorization", "").split("Bearer ")) == 2: