1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 07:08:55 +00:00

update disable pwd login

This commit is contained in:
lian
2025-02-11 15:01:48 +08:00
parent 9b43c32866
commit 93ecea748d

View File

@@ -128,6 +128,7 @@ class AuthenticationForm(forms.Form):
# get social provider identifier
enable_adfs = getattr(settings, 'ENABLE_ADFS_LOGIN', False)
enable_oauth = getattr(settings, 'ENABLE_OAUTH', False)
provider_identifier = ''
if enable_adfs or enable_mul_adfs:
provider_identifier = getattr(settings,
'SAML_PROVIDER_IDENTIFIER',
@@ -138,7 +139,8 @@ class AuthenticationForm(forms.Form):
'')
# check if disable password login
if disable_pwd_login and not is_admin:
if disable_pwd_login and not is_admin and \
(enable_adfs or enable_mul_adfs or enable_oauth):
social_user = SocialAuthUser.objects.filter(
username=username,
provider=provider_identifier