From 93ada522775aa5d04ac555dab7941bde2eb9a5a6 Mon Sep 17 00:00:00 2001 From: through-your-tears Date: Sun, 7 Apr 2024 12:34:03 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D0=B0=D0=B2=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/conf/settings.py | 2 +- src/jwtauth/serializers.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf/settings.py b/src/conf/settings.py index b0e1f49..35923bb 100644 --- a/src/conf/settings.py +++ b/src/conf/settings.py @@ -157,7 +157,7 @@ REST_FRAMEWORK = { } SWAGGER_SETTINGS = { - 'DEFAULT_AUTHENTICATION': 'authorization.backends.JWTAuthentication', + 'DEFAULT_AUTHENTICATION': 'jwtauth.backends.JWTAuthentication', 'SECURITY_DEFINITIONS': { 'Token': { 'type': 'apiKey', diff --git a/src/jwtauth/serializers.py b/src/jwtauth/serializers.py index c2bdd46..fefccf1 100644 --- a/src/jwtauth/serializers.py +++ b/src/jwtauth/serializers.py @@ -55,7 +55,7 @@ class LoginSerializer(serializers.Serializer): 'A password is required to log in' ) - user = authenticate(email=email, password=password) + user = authenticate(username=email, password=password) if user is None: raise serializers.ValidationError(