Skip to content

Commit a9375ce

Browse files
committed
update homepage routing and redirects (#5362)
1 parent 60eec03 commit a9375ce

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

apps/dashboard/src/app/components/Header/SecondaryNav/account-button.client.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export function AccountButton(props: {
104104
variant="ghost"
105105
className="justify-start px-3 text-muted-foreground text-sm hover:text-foreground"
106106
>
107-
<Link href="/">Home Page</Link>
107+
<Link href="/home">Home Page</Link>
108108
</Button>
109109

110110
{props.account && (

apps/dashboard/src/middleware.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ export async function middleware(request: NextRequest) {
4848
// remove '/' in front and then split by '/'
4949
const paths = pathname.slice(1).split("/");
5050

51+
// if it's the homepage and we have an auth cookie, redirect to the dashboard
52+
if (paths.length === 1 && paths[0] === "" && authCookie) {
53+
return redirect(request, "/team");
54+
}
55+
5156
// if the first section of the path is a number, check if it's a valid chain_id and re-write it to the slug
5257
const possibleChainId = Number(paths[0]);
5358

0 commit comments

Comments
 (0)