feat(web): redirect logged-in users from / to /issues via server-side proxy
Use a lightweight cookie (multica_logged_in) + Next.js 16 proxy to 302-redirect authenticated users visiting / straight to /issues. Unauthenticated visitors (and search engine crawlers) continue to see the full landing page with zero flash. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
8db970cd17
commit
f1e5bc7925
4 changed files with 30 additions and 0 deletions
14
apps/web/proxy.ts
Normal file
14
apps/web/proxy.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { NextResponse } from "next/server";
|
||||
import type { NextRequest } from "next/server";
|
||||
|
||||
export function proxy(request: NextRequest) {
|
||||
const loggedIn = request.cookies.has("multica_logged_in");
|
||||
if (loggedIn) {
|
||||
return NextResponse.redirect(new URL("/issues", request.url));
|
||||
}
|
||||
return NextResponse.next();
|
||||
}
|
||||
|
||||
export const config = {
|
||||
matcher: ["/"],
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue