mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-20 13:29:37 +02:00
Update backend/server/users/backends.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
806efd71bf
commit
8f1c60a440
1 changed files with 3 additions and 1 deletions
|
@ -16,7 +16,9 @@ class NoPasswordAuthBackend(ModelBackend):
|
|||
has_social_accounts = SocialAccount.objects.filter(user=allauth_user).exists()
|
||||
if has_social_accounts and getattr(allauth_user, 'disable_password', False):
|
||||
return None
|
||||
return allauth_user
|
||||
if self.user_can_authenticate(allauth_user):
|
||||
return allauth_user
|
||||
return None
|
||||
|
||||
# Fallback to regular username/password authentication
|
||||
if username is None or password is None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue