fix: exempt setup flow endpoints from license check

Add /console/api/init and /console/api/login to the license exempt
list so that fresh installs can complete setup when the enterprise
license is inactive. Without these exemptions the init password
validation and post-setup auto-login are blocked, causing the setup
page to enter an infinite reload loop.
This commit is contained in:
GareArc 2026-03-08 23:45:10 -07:00
parent 7a1f0e3258
commit 6625828246
No known key found for this signature in database

View File

@ -47,6 +47,8 @@ def create_flask_app_with_configs() -> DifyApp:
# Console bootstrap APIs exempt from license check:
# - system-features: license status for expiry UI (GlobalPublicStoreProvider)
# - setup: install/setup status check (AppInitializer)
# - init: init password validation for fresh install (InitPasswordPopup)
# - login: auto-login after setup completion (InstallForm)
# - features: billing/plan features (ProviderContextProvider)
# - account/profile: login check + user profile (AppContextProvider, useIsLogin)
# - workspaces/current: workspace + model providers (AppContextProvider)
@ -57,6 +59,8 @@ def create_flask_app_with_configs() -> DifyApp:
console_exempt_prefixes = (
"/console/api/system-features",
"/console/api/setup",
"/console/api/init",
"/console/api/login",
"/console/api/features",
"/console/api/account/profile",
"/console/api/workspaces/current",