I have this backend to authenticate a user but it fails no matter what. That password is correct the user is active but no luck. The password saved in the back end is hashed so it’s not plain text.
class EmailBackend(ModelBackend):
def authenticate(self, request, **kwargs):
email = kwargs.get("email", None)
user = User.objects.get(email=email)
if user:
if user.check_password(kwargs.get("password", None)):
return user
else:
return None
else:
User.DoesNotExist
return None
What is wrong please? How can I check if the password entered is hashed correctly or what can I do to fix this so I can actually log in