Server-rendered card-style login. Form posts to loginAction; on failure the client renders the generic 'Invalid username or password' error. Centred, mobile-first, autocomplete-friendly so phone PWAs autofill from the keychain on subsequent logins.
29 lines
722 B
TypeScript
29 lines
722 B
TypeScript
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
|
import { LoginFormClient } from "./login-form-client";
|
|
|
|
export const metadata = {
|
|
title: "Sign in",
|
|
};
|
|
|
|
interface PageProps {
|
|
searchParams: Promise<{ next?: string }>;
|
|
}
|
|
|
|
export default async function LoginPage({ searchParams }: PageProps) {
|
|
const sp = await searchParams;
|
|
const next = sp.next ?? "/";
|
|
|
|
return (
|
|
<div className="min-h-dvh flex items-center justify-center px-4 py-8">
|
|
<Card className="w-full max-w-sm">
|
|
<CardHeader>
|
|
<CardTitle>Sign in</CardTitle>
|
|
</CardHeader>
|
|
<CardContent>
|
|
<LoginFormClient next={next} />
|
|
</CardContent>
|
|
</Card>
|
|
</div>
|
|
);
|
|
}
|