refactor: 인증 페이지를 React Hook Form 컴포넌트로 마이그레이션

- signup/page.tsx: SignupForm 컴포넌트 사용
- login/page.tsx: LoginForm 컴포넌트 사용
- reset-password/page.tsx: ResetPasswordForm 컴포넌트 사용
- auth/callback/route.ts: 불필요한 주석 제거
This commit is contained in:
2026-02-04 09:35:42 +09:00
parent 462d3c1923
commit 63a09034a9
4 changed files with 59 additions and 277 deletions

View File

@@ -1,9 +1,6 @@
import Link from "next/link";
import { signup } from "@/features/auth/actions";
import FormMessage from "@/components/form-message";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import SignupForm from "@/features/auth/components/signup-form";
import {
Card,
CardContent,
@@ -46,68 +43,20 @@ export default async function SignupPage({
</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="your@email.com"
required
className="h-11 transition-all duration-200"
/>
</div>
<SignupForm />
{/* 비밀번호 입력 */}
<div className="space-y-2">
<Label htmlFor="password" className="text-sm font-medium">
</Label>
{/* pattern: 최소 8자, 대문자, 소문자, 숫자, 특수문자 각 1개 이상 */}
{/* 참고: HTML pattern에서는 <, >, {, } 등 일부 특수문자 사용 시 브라우저 호환성 문제 발생 */}
<Input
id="password"
name="password"
type="password"
placeholder="••••••••"
autoComplete="new-password"
required
minLength={6}
pattern="^(?=.*[0-9])(?=.*[!@#$%^&*]).{6,}$"
title="비밀번호는 최소 6자 이상, 숫자와 특수문자를 각각 1개 이상 포함해야 합니다."
className="h-11 transition-all duration-200"
/>
<p className="text-xs text-gray-500 dark:text-gray-400">
6 , , ( )
</p>
</div>
{/* 회원가입 버튼 */}
<Button
formAction={signup}
type="submit"
className="h-11 w-full bg-gradient-to-r from-gray-900 to-black font-semibold shadow-lg transition-all duration-200 hover:from-black hover:to-gray-800 hover:shadow-xl dark:from-white dark:to-gray-100 dark:text-black dark:hover:from-gray-100 dark:hover:to-white"
size="lg"
{/* ========== 로그인 링크 ========== */}
<p className="text-center text-sm text-gray-600 dark:text-gray-400">
?{" "}
<Link
href="/login"
className="font-semibold text-gray-900 transition-colors hover:text-black dark:text-gray-100 dark:hover:text-white"
>
</Button>
{/* 로그인 링크 */}
<p className="text-center text-sm text-gray-600 dark:text-gray-400">
?{" "}
<Link
href="/login"
className="font-semibold text-gray-900 transition-colors hover:text-black dark:text-gray-100 dark:hover:text-white"
>
</Link>
</p>
</form>
</Link>
</p>
</CardContent>
</Card>
</div>