Skip to content

Commit 23f9e2b

Browse files
committed
fix: take tenantId into consideration
1 parent 107d8d0 commit 23f9e2b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/app/src/utils/getTenantId.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,16 @@ declare global {
77
}
88

99
export const getTenantId = (): string | null => {
10+
const urlSearchParams = new URLSearchParams(location.search);
11+
1012
// 1. Get tenant via the `__tenant` query param. Useful when doing page previews.
11-
let tenant = new URLSearchParams(location.search).get("__tenant");
13+
let tenant = urlSearchParams.get("__tenant");
14+
if (tenant) {
15+
return tenant;
16+
}
17+
18+
// 1. Get tenant via the `tenantId` query param. Useful within the Admin app.
19+
tenant = urlSearchParams.get("tenantId");
1220
if (tenant) {
1321
return tenant;
1422
}

0 commit comments

Comments
 (0)