From 693a5ec778b9a4645dc52de65533f1e1591e752f Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 18 Aug 2020 12:04:42 +0300 Subject: [PATCH] Login: return an UNAUTHORIZED (401) error on bad username/password, not 400. --- django_etebase/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django_etebase/views.py b/django_etebase/views.py index 1e9b8b5..a39d443 100644 --- a/django_etebase/views.py +++ b/django_etebase/views.py @@ -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_400_BAD_REQUEST) + return Response({'code': 'login_bad_signature'}, status=status.HTTP_401_UNAUTHORIZED) return None