From a62250259652b6a388e3d2cada4f9d362a840834 Mon Sep 17 00:00:00 2001 From: ash Date: Sun, 21 Apr 2024 17:58:08 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8=20>=20=EB=B9=84?= =?UTF-8?q?=EB=B0=80=EB=B2=88=ED=98=B8=20=EC=9E=AC=EC=84=A4=EC=A0=95=20UI?= =?UTF-8?q?=20=EA=B5=AC=ED=98=84=20(#222)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ✨#221 - 비밀번호 재설정 페이지 추가 * ✨#221 - 비밀번호 재설정 폼 타입 추가 * 💄#221 - 비밀번호 재설정 폼 컴포넌트 추가 * ✨#221 - 비밀번호 재설정 폼 유효성 검사 * ✨#221 - 폼 제출 시 로그인 화면으로 이동 * ✨#221 - 비밀번호 재설정 링크 보낼 때 redirectUrl 변경 * ⚡️#221 - 폼 제출을 처리 하는 동안 버튼 disabled 처리 * ♻️#221 - PAGE_PATH 적용 및 replace로 변경 * 🧑#221 - 개행 추가 * 🔍️#221 - SEO 추가 --- src/components/account/FindPasswordForm.tsx | 10 +- src/components/account/ResetPasswordForm.tsx | 99 ++++++++++++++++++++ src/components/account/index.ts | 1 + src/pages/account/resetPassword.tsx | 22 +++++ src/types/password.ts | 5 + 5 files changed, 130 insertions(+), 7 deletions(-) create mode 100644 src/components/account/ResetPasswordForm.tsx create mode 100644 src/pages/account/resetPassword.tsx diff --git a/src/components/account/FindPasswordForm.tsx b/src/components/account/FindPasswordForm.tsx index cd9c24e5..60f4ea09 100644 --- a/src/components/account/FindPasswordForm.tsx +++ b/src/components/account/FindPasswordForm.tsx @@ -19,7 +19,7 @@ export const FindPasswordForm = ({ setIsSubmitted }: FindPasswordFormProps) => { register, handleSubmit, setError, - formState: { errors, isValid }, + formState: { errors, isValid, isSubmitting }, } = useForm({ mode: 'onChange' }); const onSubmit: SubmitHandler = async (data) => { @@ -27,11 +27,7 @@ export const FindPasswordForm = ({ setIsSubmitted }: FindPasswordFormProps) => { const { email } = data; await passwordResetLink({ email, - /** - * @todo - * redirectUrl을 비밀번호 재설정 페이지로 변경 - */ - redirectUrl: `${window.location.origin}`, + redirectUrl: `${window.location.origin}/account/resetPassword`, }); setIsSubmitted(true); } catch (error) { @@ -76,7 +72,7 @@ export const FindPasswordForm = ({ setIsSubmitted }: FindPasswordFormProps) => {