Skip to content

Commit 3bafe9d

Browse files
Merge pull request #476 from supertokens/fix/domain-normalisation
fix: dashboard connection uri path
2 parents 0063f0c + 59fbd5b commit 3bafe9d

File tree

5 files changed

+22
-8
lines changed

5 files changed

+22
-8
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
## [unreleased]
1010

11+
## [0.18.8] - 2024-02-29
12+
13+
- Fixes dashboard URI path. Now it returns the complete user given path instead of just the normalized connectionURI domain.
14+
1115
## [0.18.7] - 2024-01-17
1216

1317
- Fixes `connection_uri` normalisation in the dashboard recipe.

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070

7171
setup(
7272
name="supertokens_python",
73-
version="0.18.7",
73+
version="0.18.8",
7474
author="SuperTokens",
7575
license="Apache 2.0",
7676
author_email="[email protected]",

supertokens_python/constants.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from __future__ import annotations
1515

1616
SUPPORTED_CDI_VERSIONS = ["3.0"]
17-
VERSION = "0.18.7"
17+
VERSION = "0.18.8"
1818
TELEMETRY = "/telemetry"
1919
USER_COUNT = "/users/count"
2020
USER_DELETE = "/user/remove"

supertokens_python/recipe/dashboard/api/implementation.py

+12-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,18 @@ async def dashboard_get(
5050
connection_uri = ""
5151
super_tokens_instance = Supertokens.get_instance()
5252
auth_mode = options.config.auth_mode
53-
connection_uri = NormalisedURLDomain(
54-
super_tokens_instance.supertokens_config.connection_uri.split(";")[0]
55-
).get_as_string_dangerous()
53+
connection_uri = (
54+
NormalisedURLDomain(
55+
super_tokens_instance.supertokens_config.connection_uri.split(";")[
56+
0
57+
]
58+
).get_as_string_dangerous()
59+
+ NormalisedURLPath(
60+
super_tokens_instance.supertokens_config.connection_uri.split(";")[
61+
0
62+
]
63+
).get_as_string_dangerous()
64+
)
5665

5766
dashboard_path = options.app_info.api_base_path.append(
5867
NormalisedURLPath(DASHBOARD_API)

tests/dashboard/test_dashboard.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ async def test_connection_uri_has_http_prefix_if_localhost(app: TestClient):
163163

164164
async def test_connection_uri_has_https_prefix_if_not_localhost(app: TestClient):
165165
start_st()
166-
connection_uri = "https://try.supertokens.com"
166+
connection_uri = "https://try.supertokens.com/appid-public"
167167
connection_uri_without_protocol = connection_uri.replace("https://", "")
168168

169169
st_args = get_st_init_args(
@@ -189,8 +189,9 @@ async def test_connection_uri_has_https_prefix_if_not_localhost(app: TestClient)
189189
async def test_that_first_connection_uri_is_selected_among_multiple_uris(
190190
app: TestClient,
191191
):
192-
first_connection_uri = start_st()
193-
second_connection_uri = "https://try.supertokens.com"
192+
start_st()
193+
first_connection_uri = "https://try.supertokens.com/appid-public"
194+
second_connection_uri = "https://test.supertokens.com/"
194195
multiple_connection_uris = f"{first_connection_uri};{second_connection_uri}"
195196

196197
st_args = get_st_init_args(

0 commit comments

Comments
 (0)