Skip to content

Commit 6b9e068

Browse files
committed
search flag
1 parent 0597dab commit 6b9e068

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

supertokens_python/recipe/dashboard/api/implementation.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
from supertokens_python import Supertokens
2121
from supertokens_python.normalised_url_domain import NormalisedURLDomain
2222
from supertokens_python.normalised_url_path import NormalisedURLPath
23+
from supertokens_python.querier import Querier
24+
from supertokens_python.utils import is_version_gte
2325

2426
from ..constants import DASHBOARD_API
2527
from ..interfaces import APIInterface
@@ -54,6 +56,14 @@ async def dashboard_get(
5456
NormalisedURLPath(DASHBOARD_API)
5557
).get_as_string_dangerous()
5658

59+
is_search_enabled: bool = False
60+
querier = Querier.get_instance(options.recipe_id)
61+
cdiVersion = await querier.get_api_version()
62+
if not cdiVersion:
63+
return ""
64+
if is_version_gte(cdiVersion, "2.20"):
65+
is_search_enabled = True
66+
5767
return Template(
5868
dedent(
5969
"""
@@ -65,6 +75,7 @@ async def dashboard_get(
6575
window.dashboardAppPath = "${dashboardPath}"
6676
window.connectionURI = "${connectionURI}"
6777
window.authMode = "${authMode}"
78+
window.isSearchEnabled = "${isSearchEnabled}"
6879
</script>
6980
<script defer src="${bundleDomain}/static/js/bundle.js"></script></head>
7081
<link href="${bundleDomain}/static/css/main.css" rel="stylesheet" type="text/css">
@@ -82,6 +93,7 @@ async def dashboard_get(
8293
dashboardPath=dashboard_path,
8394
connectionURI=connection_uri,
8495
authMode=auth_mode,
96+
isSearchEnabled=is_search_enabled,
8597
)
8698

8799
self.dashboard_get = dashboard_get

0 commit comments

Comments
 (0)