Merge pull request #1595 from richard-guan-dev/main

fix: Add a validation check to see if "assisted verification users" are active when logging in.
This commit is contained in:
jxxghp 2024-03-06 10:44:44 +08:00 committed by GitHub
commit 01e08c8e69
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -49,6 +49,9 @@ async def login_access_token(
is_superuser=False, hashed_password=get_password_hash(token))
user.create(db)
else:
# 辅助验证用户若未启用,则禁止登录
if not user.is_active:
raise HTTPException(status_code=403, detail="用户未启用")
# 普通用户权限
user.is_superuser = False
elif not user.is_active: