Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix:After setting user's is_active to 0, the user can still log in to RAGFlow. (#10325)

Stephen Hu723cf9443e55
diff --git a/api/apps/user_app.py b/api/apps/user_app.py
index 95a6e2dc4c..3415b33fbf 100644
--- a/api/apps/user_app.py
+++ b/api/apps/user_app.py
@@ -98,6 +98,15 @@ def login():
return get_json_result(data=False, code=settings.RetCode.SERVER_ERROR, message="Fail to crypt password")
user = UserService.query_user(email, password)
+
+ if user and hasattr(user, 'is_active') and user.is_active == "0":
+ return get_json_result(
+ data=False,
+ code=settings.RetCode.FORBIDDEN,
+ message="This account has been disabled, please contact the administrator!",
+ )
+
+
if user:
response_data = user.to_json()
user.access_token = get_uuid()