20
20
from supertokens_python import Supertokens
21
21
from supertokens_python .normalised_url_domain import NormalisedURLDomain
22
22
from supertokens_python .normalised_url_path import NormalisedURLPath
23
+ from supertokens_python .querier import Querier
24
+ from supertokens_python .utils import is_version_gte
23
25
24
26
from ..constants import DASHBOARD_API
25
27
from ..interfaces import APIInterface
@@ -54,6 +56,14 @@ async def dashboard_get(
54
56
NormalisedURLPath (DASHBOARD_API )
55
57
).get_as_string_dangerous ()
56
58
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
+
57
67
return Template (
58
68
dedent (
59
69
"""
@@ -65,6 +75,7 @@ async def dashboard_get(
65
75
window.dashboardAppPath = "${dashboardPath}"
66
76
window.connectionURI = "${connectionURI}"
67
77
window.authMode = "${authMode}"
78
+ window.isSearchEnabled = "${isSearchEnabled}"
68
79
</script>
69
80
<script defer src="${bundleDomain}/static/js/bundle.js"></script></head>
70
81
<link href="${bundleDomain}/static/css/main.css" rel="stylesheet" type="text/css">
@@ -82,6 +93,7 @@ async def dashboard_get(
82
93
dashboardPath = dashboard_path ,
83
94
connectionURI = connection_uri ,
84
95
authMode = auth_mode ,
96
+ isSearchEnabled = is_search_enabled ,
85
97
)
86
98
87
99
self .dashboard_get = dashboard_get
0 commit comments