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:
commit
01e08c8e69
@ -49,6 +49,9 @@ async def login_access_token(
|
|||||||
is_superuser=False, hashed_password=get_password_hash(token))
|
is_superuser=False, hashed_password=get_password_hash(token))
|
||||||
user.create(db)
|
user.create(db)
|
||||||
else:
|
else:
|
||||||
|
# 辅助验证用户若未启用,则禁止登录
|
||||||
|
if not user.is_active:
|
||||||
|
raise HTTPException(status_code=403, detail="用户未启用")
|
||||||
# 普通用户权限
|
# 普通用户权限
|
||||||
user.is_superuser = False
|
user.is_superuser = False
|
||||||
elif not user.is_active:
|
elif not user.is_active:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user