Skip to content

Commit 5fb1e59

Browse files
committed
refactor: do not check user.is_active on user validation
1 parent c35755a commit 5fb1e59

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

oauth2_provider/oauth2_validators.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,10 @@ def validate_user(self, username, password, client, request, *args, **kwargs):
626626
Check username and password correspond to a valid and active User
627627
"""
628628
u = authenticate(username=username, password=password)
629-
if u is not None and u.is_active:
629+
630+
# NOTE: [11/20/2020] Removed check for u.is_active because the check
631+
# will be made *before* calling DOT (Django OAuth Toolkit)
632+
if u is not None:
630633
request.user = u
631634
return True
632635
return False

0 commit comments

Comments
 (0)