Skip to content

Commit

Permalink
fix(app): trim quotes when reading tenant id (#4326)
Browse files Browse the repository at this point in the history
  • Loading branch information
brunozoric authored Oct 10, 2024
1 parent c2bad0d commit 65fd703
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/app/src/utils/getTenantId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ export const getTenantId = (): string | null => {
// 3. Get tenant via `window.localStorage.webiny_tenant`. Used within the Admin app.
tenant = window.localStorage.webiny_tenant;
if (tenant) {
try {
const value = JSON.parse(tenant);
if (value) {
return value;
}
} catch {
// do nothing
}
return tenant;
}

Expand Down

0 comments on commit 65fd703

Please sign in to comment.