Skip to content

Commit

Permalink
fix: dashboard connection uri path. (#795)
Browse files Browse the repository at this point in the history
* fix: dashboard connection  uri path.

* bump v16.7.3
  • Loading branch information
Chakravarthy7102 authored Feb 26, 2024
1 parent ef95404 commit 47f03d8
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [unreleased]

## [16.7.3] - 2024-02-26

- Fixes dashboard URI path. Now it returns the complete user given path instead of just the normalized connectionURI domain.

## [16.7.2] - 2024-02-19

- `createNewSession` now defaults to the value of the `st-auth-mode` header (if available) if the configured `getTokenTransferMethod` returns `any`.
Expand Down
10 changes: 7 additions & 3 deletions lib/build/recipe/dashboard/api/implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ function getAPIImplementation() {
const superTokensInstance = supertokens_1.default.getInstanceOrThrowError();
const authMode = input.options.config.authMode;
if (superTokensInstance.supertokens !== undefined) {
connectionURI = new normalisedURLDomain_1.default(
superTokensInstance.supertokens.connectionURI.split(";")[0]
).getAsStringDangerous();
connectionURI =
new normalisedURLDomain_1.default(
superTokensInstance.supertokens.connectionURI.split(";")[0]
).getAsStringDangerous() +
new normalisedURLPath_1.default(
superTokensInstance.supertokens.connectionURI.split(";")[0]
).getAsStringDangerous();
}
let isSearchEnabled = false;
const cdiVersion = await querier_1.Querier.getNewInstanceOrThrowError(
Expand Down
2 changes: 1 addition & 1 deletion lib/build/version.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/build/version.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions lib/ts/recipe/dashboard/api/implementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ export default function getAPIImplementation(): APIInterface {
const authMode: AuthMode = input.options.config.authMode;

if (superTokensInstance.supertokens !== undefined) {
connectionURI = new NormalisedURLDomain(
superTokensInstance.supertokens.connectionURI.split(";")[0]
).getAsStringDangerous();
connectionURI =
new NormalisedURLDomain(
superTokensInstance.supertokens.connectionURI.split(";")[0]
).getAsStringDangerous() +
new NormalisedURLPath(
superTokensInstance.supertokens.connectionURI.split(";")[0]
).getAsStringDangerous();
}

let isSearchEnabled = false;
Expand Down
2 changes: 1 addition & 1 deletion lib/ts/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
export const version = "16.7.2";
export const version = "16.7.3";

export const cdiSupported = ["4.0"];

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "supertokens-node",
"version": "16.7.2",
"version": "16.7.3",
"description": "NodeJS driver for SuperTokens core",
"main": "index.js",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions test/dashboard/dashboardGet.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe(`User Dashboard get: ${printPath("[test/dashboard/dashboardGet.test.js]
});

it("Test connectionURI contains https protocol", async () => {
const connectionURI = "https://try.supertokens.com";
const connectionURI = "https://try.supertokens.com/appid-public";
// removing protocol from the original connectionURI.
const connectionURIWithoutProtocol = connectionURI.replace("https://", "");

Expand Down Expand Up @@ -113,8 +113,8 @@ describe(`User Dashboard get: ${printPath("[test/dashboard/dashboardGet.test.js]
});

it("Test multiple connection URIs", async () => {
const firstConnectionURI = await startST();
const secondConnectionURI = "https://try.supertokens.com";
const firstConnectionURI = "https://try.supertokens.com/appid-public";
const secondConnectionURI = await startST();

const multipleConnectionURIs = `${firstConnectionURI};${secondConnectionURI}`;

Expand Down

0 comments on commit 47f03d8

Please sign in to comment.