Files
auto-trade/app/(auth)/forgot-password/page.tsx
2026-02-11 14:06:06 +09:00

88 lines
3.3 KiB
TypeScript

import FormMessage from "@/components/form-message";
import { requestPasswordReset } from "@/features/auth/actions";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import Link from "next/link";
import { AUTH_ROUTES } from "@/features/auth/constants";
import { Mail } from "lucide-react";
/**
* [비밀번호 찾기 페이지]
*
* 사용자가 비밀번호를 잊어버렸을 때 재설정 링크를 요청하는 페이지입니다.
* - 이메일 입력 폼 제공
* - 서버 액션(requestPasswordReset)과 연동
*/
export default async function ForgotPasswordPage({
searchParams,
}: {
searchParams: Promise<{ message?: string }>;
}) {
const { message } = await searchParams;
return (
<div className="relative z-10 w-full max-w-md animate-in fade-in slide-in-from-bottom-4 duration-700">
{message && <FormMessage message={message} />}
<Card className="border-brand-200/30 bg-white/80 shadow-2xl shadow-brand-500/5 backdrop-blur-xl dark:border-brand-800/30 dark:bg-brand-950/70">
<CardHeader className="space-y-3 text-center">
<div className="mx-auto mb-2 flex h-16 w-16 items-center justify-center rounded-2xl bg-linear-to-br from-brand-500 to-brand-700 shadow-lg shadow-brand-500/25">
<Mail className="h-7 w-7 text-white" />
</div>
<CardTitle className="text-3xl font-bold tracking-tight">
</CardTitle>
<CardDescription className="text-base">
.
<br />
.
</CardDescription>
</CardHeader>
<CardContent className="space-y-6">
<form className="space-y-5">
<div className="space-y-2">
<Label htmlFor="email" className="text-sm font-medium">
</Label>
<Input
id="email"
name="email"
type="email"
placeholder="name@example.com"
autoComplete="email"
required
className="h-11 transition-all duration-200 focus-visible:ring-brand-500"
/>
</div>
<Button
formAction={requestPasswordReset}
className="h-11 w-full bg-linear-to-r from-brand-500 to-brand-700 font-semibold text-white shadow-lg shadow-brand-500/20 transition-all hover:from-brand-600 hover:to-brand-800 hover:shadow-xl hover:shadow-brand-500/25"
>
</Button>
</form>
<div className="text-center">
<Link
href={AUTH_ROUTES.LOGIN}
className="text-sm font-medium text-brand-600 transition-colors hover:text-brand-700 dark:text-brand-400 dark:hover:text-brand-300"
>
</Link>
</div>
</CardContent>
</Card>
</div>
);
}