Skip to content

Commit 67cf9ce

Browse files
committed
Dashboard: Add redirects for project pages
1 parent a331054 commit 67cf9ce

File tree

2 files changed

+49
-9
lines changed
  • apps/dashboard

2 files changed

+49
-9
lines changed

apps/dashboard/redirects.js

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,51 @@ const legacyDashboardToTeamRedirects = [
6262
},
6363
];
6464

65+
const projectRoute = "/team/:team_slug/:project_slug";
66+
67+
const projectPageRedirects = [
68+
{
69+
source: `${projectRoute}/connect/pay/:path*`,
70+
destination: `${projectRoute}/universal-bridge/:path*`,
71+
permanent: false,
72+
},
73+
{
74+
source: `${projectRoute}/connect/universal-bridge/:path*`,
75+
destination: `${projectRoute}/universal-bridge/:path*`,
76+
permanent: false,
77+
},
78+
{
79+
source: `${projectRoute}/connect/account-abstraction/:path*`,
80+
destination: `${projectRoute}/account-abstraction/:path*`,
81+
permanent: false,
82+
},
83+
{
84+
source: `${projectRoute}/connect/in-app-wallets/:path*`,
85+
destination: `${projectRoute}/wallets/:path*`,
86+
permanent: false,
87+
},
88+
{
89+
source: `${projectRoute}/engine/cloud/vault/:path*`,
90+
destination: `${projectRoute}/vault/:path*`,
91+
permanent: false,
92+
},
93+
{
94+
source: `${projectRoute}/engine/cloud/:path*`,
95+
destination: `${projectRoute}/transactions/:path*`,
96+
permanent: false,
97+
},
98+
{
99+
source: `${projectRoute}/assets/:path*`,
100+
destination: `${projectRoute}/tokens/:path*`,
101+
permanent: false,
102+
},
103+
{
104+
source: `${projectRoute}/nebula/:path*`,
105+
destination: projectRoute,
106+
permanent: false,
107+
},
108+
];
109+
65110
/** @type {import('next').NextConfig['redirects']} */
66111
async function redirects() {
67112
return [
@@ -326,14 +371,6 @@ async function redirects() {
326371
destination: "/",
327372
permanent: false,
328373
},
329-
// pay > universal-bridge redirect
330-
{
331-
source: "/team/:team_slug/:project_slug/connect/pay/:path*",
332-
destination:
333-
"/team/:team_slug/:project_slug/connect/universal-bridge/:path*",
334-
permanent: false,
335-
},
336-
337374
// all /learn/tutorials (and sub-routes) -> /learn/guides
338375
{
339376
source: "/learn/tutorials/:path*",
@@ -382,8 +419,8 @@ async function redirects() {
382419
destination: "/transactions",
383420
permanent: false,
384421
},
385-
386422
...legacyDashboardToTeamRedirects,
423+
...projectPageRedirects,
387424
];
388425
}
389426

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/analytics/utils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ export function storeUserAccessToken(projectId: string, accessToken: string) {
66
}
77

88
export function getUserAccessToken(projectId: string) {
9+
if (typeof localStorage === "undefined") {
10+
return null;
11+
}
912
return localStorage.getItem(
1013
`thirdweb:engine-cloud-user-access-token-${projectId}`,
1114
);

0 commit comments

Comments
 (0)