Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

perf(web): redirect authenticated users from homepage in proxy

Richie McIlroy272fbf1893c3
diff --git a/apps/web/proxy.ts b/apps/web/proxy.ts
index da1a3bd26..36ee15452 100644
--- a/apps/web/proxy.ts
+++ b/apps/web/proxy.ts
@@ -24,6 +24,10 @@ export async function proxy(request: NextRequest) {
const url = new URL(request.url);
const path = url.pathname;
+ if (path === "/" && request.cookies.has("next-auth.session-token")) {
+ return NextResponse.redirect(new URL("/dashboard/caps", url.origin));
+ }
+
if (path.startsWith("/login")) {
const response = NextResponse.next();
response.headers.set("X-Frame-Options", "SAMEORIGIN");