Merge pull request #2703 from InfinityPacer/feature/auth

This commit is contained in:
jxxghp
2024-09-13 08:32:54 +08:00
committed by GitHub
3 changed files with 6 additions and 2 deletions

View File

@@ -38,8 +38,8 @@ async def login_access_token(
otp_password=otp_password
)
if not success:
# 认证不成功
if not user:
# 认证不成功且开启了辅助认证
if not user and settings.AUXILIARY_AUTH_ENABLE:
# 未找到用户,请求协助认证
logger.warn(f"登录用户 {form_data.username} 本地不存在,尝试辅助认证 ...")
token = UserChain().user_authenticate(form_data.username, form_data.password)