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(