Skip to content

Commit 8bd8d60

Browse files
authored
Prevent double-validation in LoginSerializer
Modified branching statement to prevent double-validation when using "email" as the authentication method with Allauth.
1 parent 658664a commit 8bd8d60

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rest_auth/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def validate(self, attrs):
7171
user = self._validate_email(email, password)
7272

7373
# Authentication through username
74-
if app_settings.AUTHENTICATION_METHOD == app_settings.AuthenticationMethod.USERNAME:
74+
elif app_settings.AUTHENTICATION_METHOD == app_settings.AuthenticationMethod.USERNAME:
7575
user = self._validate_username(username, password)
7676

7777
# Authentication through either username or email

0 commit comments

Comments
 (0)