You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi I have the following piece of code with TokenAuthentication.
class SignInModelBackend(ModelBackend):
def authenticate(self, request, username=None, password=None, **kwargs):
if "@" in username:
kwargs = {"email": username}
else:
kwargs = {"username": username}
try:
user = UserModel.objects.get(**kwargs)
if user.check_password(password):
return user
return None
except UserModel.DoesNotExist:
raise AuthenticationFailed(
detail="Provided email address or username doesn't match any account.",
)
I'm trying to understand why my AuthenticationFailed still returns a 403 Forbidden status code while AuthenticationFailed is defined as follows:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Hi I have the following piece of code with
TokenAuthentication.I'm trying to understand why my
AuthenticationFailedstill returns a403 Forbiddenstatus code whileAuthenticationFailedis defined as follows:All reactions