From 1308101fe626d3a968b2def6db863d6e27f97ef5 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Tue, 20 Jan 2026 12:45:28 +0530 Subject: [PATCH] fix: parse allowed_endpoints to list if its string --- lms/auth.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lms/auth.py b/lms/auth.py index f745a080..51ad9d80 100644 --- a/lms/auth.py +++ b/lms/auth.py @@ -1,3 +1,5 @@ +import json + import frappe ALLOWED_PATHS = [ @@ -84,6 +86,14 @@ def is_server_script_path(path): def is_custom_app_endpoint(path): allowed_custom_endpoints = frappe.conf.get("allowed_custom_endpoints", []) + + if isinstance(allowed_custom_endpoints, str): + try: + parsed = json.loads(allowed_custom_endpoints) + allowed_custom_endpoints = parsed if isinstance(parsed, list) else [allowed_custom_endpoints] + except Exception: + allowed_custom_endpoints = [allowed_custom_endpoints] + for endpoint in allowed_custom_endpoints: if endpoint in path: return True