Add even more check to login because passwords are so hard

This commit is contained in:
Tanner Collin 2022-02-10 01:49:19 +00:00
parent 87863b3baf
commit 06f03e1ce9

View File

@ -792,4 +792,9 @@ class MyLoginSerializer(LoginSerializer):
if not User.objects.filter(username=username).exists():
raise ValidationError(dict(username='Username not found. Try "first.last" or "first.middle.last".'))
return super().authenticate(**kwargs)
user = super().authenticate(**kwargs)
if not user:
raise ValidationError(dict(password='Incorrect password. Check caps lock.'))
return user