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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user