page.jsx 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import LoginForm from "@/components/auth/LoginForm";
  2. import { parseLoginParams } from "@/lib/frontend/authRedirect";
  3. /**
  4. * /login (RHL-020)
  5. *
  6. * Server Component:
  7. * - Parses query params on the server (reason/next).
  8. * - Renders a Client Component (LoginForm) for the actual interaction.
  9. *
  10. * Query params:
  11. * - reason=expired | logged-out
  12. * - next=/some/internal/path
  13. */
  14. export default async function LoginPage({ searchParams }) {
  15. // In newer Next versions, searchParams can be async; awaiting is safe.
  16. const resolvedSearchParams = await searchParams;
  17. // Parse + sanitize using shared pure helper.
  18. const { reason, next } = parseLoginParams(resolvedSearchParams);
  19. return (
  20. <div className="w-full space-y-6">
  21. <div className="space-y-2 text-center">
  22. <h1 className="text-2xl font-semibold tracking-tight">
  23. RHL Lieferscheine
  24. </h1>
  25. <p className="text-sm text-muted-foreground">
  26. Bitte melden Sie sich an, um fortzufahren.
  27. </p>
  28. </div>
  29. <LoginForm reason={reason} nextPath={next} />
  30. <p className="text-center text-xs text-muted-foreground">
  31. Bei Fragen wenden Sie sich an Ihren Administrator.
  32. </p>
  33. </div>
  34. );
  35. }