2026-02-05 15:56:41 +09:00
|
|
|
|
import FormMessage from "@/components/form-message";
|
|
|
|
|
|
import ResetPasswordForm from "@/features/auth/components/reset-password-form";
|
|
|
|
|
|
import {
|
|
|
|
|
|
Card,
|
|
|
|
|
|
CardContent,
|
|
|
|
|
|
CardDescription,
|
|
|
|
|
|
CardHeader,
|
|
|
|
|
|
CardTitle,
|
|
|
|
|
|
} from "@/components/ui/card";
|
|
|
|
|
|
import { createClient } from "@/utils/supabase/server";
|
|
|
|
|
|
import { redirect } from "next/navigation";
|
2026-02-11 14:06:06 +09:00
|
|
|
|
import { KeyRound } from "lucide-react";
|
2026-02-05 15:56:41 +09:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* [비밀번호 재설정 페이지]
|
|
|
|
|
|
*
|
|
|
|
|
|
* 이메일 링크를 타고 들어온 사용자가 새 비밀번호를 설정하는 페이지입니다.
|
|
|
|
|
|
* - URL에 포함된 토큰 검증은 Middleware 및 Auth Confirm Route에서 선행됩니다.
|
|
|
|
|
|
* - 유효한 세션(Recovery Mode)이 없으면 로그인 페이지로 리다이렉트됩니다.
|
|
|
|
|
|
*/
|
|
|
|
|
|
export default async function ResetPasswordPage({
|
|
|
|
|
|
searchParams,
|
|
|
|
|
|
}: {
|
|
|
|
|
|
searchParams: Promise<{ message?: string }>;
|
|
|
|
|
|
}) {
|
|
|
|
|
|
const params = await searchParams;
|
|
|
|
|
|
const supabase = await createClient();
|
|
|
|
|
|
|
|
|
|
|
|
const {
|
|
|
|
|
|
data: { user },
|
|
|
|
|
|
} = await supabase.auth.getUser();
|
|
|
|
|
|
|
|
|
|
|
|
if (!user) {
|
2026-02-06 09:14:49 +09:00
|
|
|
|
redirect(`/login`);
|
2026-02-05 15:56:41 +09:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const { message } = params;
|
|
|
|
|
|
|
|
|
|
|
|
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} />}
|
|
|
|
|
|
|
2026-02-11 14:06:06 +09:00
|
|
|
|
<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">
|
2026-02-05 15:56:41 +09:00
|
|
|
|
<CardHeader className="space-y-3 text-center">
|
2026-02-11 14:06:06 +09:00
|
|
|
|
<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">
|
|
|
|
|
|
<KeyRound className="h-7 w-7 text-white" />
|
2026-02-05 15:56:41 +09:00
|
|
|
|
</div>
|
|
|
|
|
|
<CardTitle className="text-3xl font-bold tracking-tight">
|
|
|
|
|
|
비밀번호 재설정
|
|
|
|
|
|
</CardTitle>
|
|
|
|
|
|
<CardDescription className="text-base">
|
|
|
|
|
|
새 비밀번호를 입력해 주세요.
|
|
|
|
|
|
</CardDescription>
|
|
|
|
|
|
</CardHeader>
|
|
|
|
|
|
|
|
|
|
|
|
<CardContent className="space-y-6">
|
|
|
|
|
|
<ResetPasswordForm />
|
|
|
|
|
|
</CardContent>
|
|
|
|
|
|
</Card>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|