Skip to content

Commit da16192

Browse files
committed
fix: redirect to tenant selection when tenant not found
Replace hardcoded app URL redirect with tenantSelectionHref when tenant is not found to ensure consistent behavior across pages
1 parent 4aba57c commit da16192

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/app/(frontend)/[...slugs]/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ export default async function Page(params: Args) {
8787
const tenant = await getTenantBySubDomain(subdomain);
8888

8989
if (!tenant) {
90-
const appUrl = process.env.NEXT_PUBLIC_APP_URL!;
91-
redirect(appUrl);
90+
redirect(tenantSelectionHref);
9291
}
9392

9493
const { title, description, navigation, footer } =

src/app/(frontend)/[entitySlug]/promises/[promiseId]/page.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,7 @@ export default async function PromiseDetailPage({
170170
const tenant = await getTenantBySubDomain(subdomain);
171171

172172
if (!tenant) {
173-
if (!tenant) {
174-
const appUrl = process.env.NEXT_PUBLIC_APP_URL!;
175-
redirect(appUrl);
176-
}
173+
redirect(tenantSelectionHref);
177174
}
178175

179176
const { title, description, navigation, footer } =

0 commit comments

Comments
 (0)