mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-21 05:16:54 +08:00
Feat: Reject default admin account log in to normal services (#11994)
### What problem does this PR solve? Feat: Reject default admin account log in to normal services #11854 #11673 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -98,6 +98,9 @@ async def login():
|
|||||||
return get_json_result(data=False, code=RetCode.AUTHENTICATION_ERROR, message="Unauthorized!")
|
return get_json_result(data=False, code=RetCode.AUTHENTICATION_ERROR, message="Unauthorized!")
|
||||||
|
|
||||||
email = json_body.get("email", "")
|
email = json_body.get("email", "")
|
||||||
|
if email == "admin@ragflow.io":
|
||||||
|
return get_json_result(data=False, code=RetCode.AUTHENTICATION_ERROR, message="Default admin account cannot be used to login normal services!")
|
||||||
|
|
||||||
users = UserService.query(email=email)
|
users = UserService.query(email=email)
|
||||||
if not users:
|
if not users:
|
||||||
return get_json_result(
|
return get_json_result(
|
||||||
|
|||||||
Reference in New Issue
Block a user