mirror of
https://github.com/langgenius/dify.git
synced 2026-01-08 07:14:14 +00:00
api: support to config disabling Swagger UI in api service (#24440)
This commit is contained in:
@@ -21,7 +21,7 @@ login_manager = flask_login.LoginManager()
|
||||
def load_user_from_request(request_from_flask_login):
|
||||
"""Load user based on the request."""
|
||||
# Skip authentication for documentation endpoints
|
||||
if request.path.endswith("/docs") or request.path.endswith("/swagger.json"):
|
||||
if dify_config.SWAGGER_UI_ENABLED and request.path.endswith((dify_config.SWAGGER_UI_PATH, "/swagger.json")):
|
||||
return None
|
||||
|
||||
auth_header = request.headers.get("Authorization", "")
|
||||
|
||||
Reference in New Issue
Block a user