Add LoginLink client component that captures current path via usePathname() and passes it as returnTo query param. Update login page to read and sanitize returnTo (open-redirect guard: must start with /, reject //). Update LoginForm to redirect to returnTo after successful login. Wire LandingPage CTA through LoginLink. Add returnTo redirect for already- authed users hitting /login. Add return-URL to flappy page redirect. Remove trailing blank line from (frontend) layout.
22 lines
879 B
TypeScript
22 lines
879 B
TypeScript
import { Button } from "@/components/ui/button";
|
|
import AppLogo from "@/components/graphics/AppLogo";
|
|
import { LoginLink } from "@/components/frontend/auth/LoginLink";
|
|
|
|
export function LandingPage() {
|
|
return (
|
|
<div className="min-h-screen flex flex-col items-center justify-center p-5 gap-6 bg-background">
|
|
<div className="flex flex-col items-center gap-3 text-center max-w-md">
|
|
<div className="w-[260px] pb-2 [&_img]:w-full [&_img]:h-auto">
|
|
<AppLogo />
|
|
</div>
|
|
<p className="text-sm text-muted-foreground">
|
|
Classified operations portal for Polaris Task Force, an Arma 3 unit. Log in to access the
|
|
operations dashboard, intelligence, and logistics.
|
|
</p>
|
|
<Button asChild className="mt-2">
|
|
<LoginLink>Log in to access the portal</LoginLink>
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|