fix: openid 三方登录限制bug (#10480)

Co-authored-by: feng <1304903146@qq.com>
pull/10484/head
fit2bot 2023-05-17 19:05:28 +08:00 committed by GitHub
parent 36aa0d301b
commit b0b14fe2e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -135,9 +135,6 @@ def on_ldap_create_user(sender, user, ldap_user, **kwargs):
@receiver(openid_create_or_update_user)
def on_openid_create_or_update_user(sender, request, user, created, name, username, email, **kwargs):
if not check_only_allow_exist_user_auth(created):
return
if created:
logger.debug(
"Receive OpenID user created signal: {}, "
@ -145,7 +142,11 @@ def on_openid_create_or_update_user(sender, request, user, created, name, userna
)
user.source = User.Source.openid.value
user.save()
elif not created and settings.AUTH_OPENID_ALWAYS_UPDATE_USER:
if not check_only_allow_exist_user_auth(created):
return
if not created and settings.AUTH_OPENID_ALWAYS_UPDATE_USER:
logger.debug(
"Receive OpenID user updated signal: {}, "
"Update user info: {}"