Login: add a user visible error on password failure.

This commit is contained in:
Tom Hacohen 2020-08-18 12:24:30 +03:00
parent 693a5ec778
commit 8593ab1357

View File

@ -683,7 +683,7 @@ class AuthenticationViewSet(viewsets.ViewSet):
try:
verify_key.verify(response_raw, signature)
except nacl.exceptions.BadSignatureError:
return Response({'code': 'login_bad_signature'}, status=status.HTTP_401_UNAUTHORIZED)
return Response({'code': 'login_bad_signature', 'detail': 'Wrong password for user.'}, status=status.HTTP_401_UNAUTHORIZED)
return None