mirror of
https://github.com/WGDashboard/WGDashboard-PRW.git
synced 2026-08-03 22:42:57 +00:00
Updated some routes
This commit is contained in:
@@ -29,8 +29,9 @@ white_list = [
|
|||||||
"/static/",
|
"/static/",
|
||||||
"/api/auth",
|
"/api/auth",
|
||||||
"/api/auth/validate",
|
"/api/auth/validate",
|
||||||
|
"/api/auth/totp", # Need a GET to see if TOTP is enabled
|
||||||
"/api/dashboard/locale",
|
"/api/dashboard/locale",
|
||||||
"/api/dashboard/configuration",
|
# "/api/dashboard/configuration",
|
||||||
"/api/dashboard/theme",
|
"/api/dashboard/theme",
|
||||||
"/api/dashboard/version",
|
"/api/dashboard/version",
|
||||||
"/api/dashboard/totp",
|
"/api/dashboard/totp",
|
||||||
@@ -49,6 +50,7 @@ def authentication_required():
|
|||||||
|
|
||||||
auth_required_flag = config_server.get('auth_req', True)
|
auth_required_flag = config_server.get('auth_req', True)
|
||||||
api_key_enabled = config_server.get("wgdashboard_apikey", False)
|
api_key_enabled = config_server.get("wgdashboard_apikey", False)
|
||||||
|
app_prefix = config_server.get("app_prefix", "")
|
||||||
|
|
||||||
if not auth_required_flag:
|
if not auth_required_flag:
|
||||||
return
|
return
|
||||||
@@ -64,7 +66,11 @@ def authentication_required():
|
|||||||
|
|
||||||
if flask.session.get("role") == "admin":
|
if flask.session.get("role") == "admin":
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Handle Client Dashboard Path
|
||||||
|
if path.startswith(f'{app_prefix}/client'):
|
||||||
|
return
|
||||||
|
|
||||||
if routes_utils.is_path_allowed(path, white_list, flask.session):
|
if routes_utils.is_path_allowed(path, white_list, flask.session):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user