Skip to content

Commit 21c8376

Browse files
committed
[TOOL-3483] Dashboard: Fix Nebula subdomain rewrite in Vercel preview links
1 parent 724e7d9 commit 21c8376

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apps/dashboard/src/middleware.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ export async function middleware(request: NextRequest) {
3333
const paths = pathname.slice(1).split("/");
3434

3535
// nebula.thirdweb.com -> render page at app/nebula-app
36-
if (subdomain === "nebula" && host) {
36+
// on vercel preview, the format is nebula---thirdweb-www-git-<branch-name>.thirdweb-preview.com
37+
if (
38+
subdomain &&
39+
(subdomain === "nebula" || subdomain.includes("nebula---"))
40+
) {
3741
const newPaths = ["nebula-app", ...paths];
3842
return rewrite(request, `/${newPaths.join("/")}`, undefined);
3943
}

0 commit comments

Comments
 (0)