| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- // ---------------------------------------------------------------------------
- // Folder: app/(public)/login
- // File: page.jsx
- // Relative Path: app/(public)/login/page.jsx
- // ---------------------------------------------------------------------------
- import LoginForm from "@/components/auth/LoginForm";
- import { parseLoginParams } from "@/lib/frontend/authRedirect";
- /**
- * /login (RHL-020)
- *
- * Server Component:
- * - Parses query params on the server (reason/next).
- * - Renders a Client Component (LoginForm) for the actual interaction.
- *
- * Query params:
- * - reason=expired | logged-out
- * - next=/some/internal/path
- */
- export default async function LoginPage({ searchParams }) {
- // In newer Next versions, searchParams can be async; awaiting is safe.
- const resolvedSearchParams = await searchParams;
- // Parse + sanitize using shared pure helper.
- const { reason, next } = parseLoginParams(resolvedSearchParams);
- return (
- <div className="w-full space-y-6">
- <div className="space-y-2 text-center">
- <h1 className="text-2xl font-semibold tracking-tight">
- RHL Lieferscheine
- </h1>
- <p className="text-sm text-muted-foreground">Sign in to continue</p>
- </div>
- <LoginForm reason={reason} nextPath={next} />
- <p className="text-center text-xs text-muted-foreground">
- For support, contact your administrator.
- </p>
- </div>
- );
- }
|