diff --git a/src/apis/instance.ts b/src/apis/instance.ts index cb4370c..2cfda2d 100644 --- a/src/apis/instance.ts +++ b/src/apis/instance.ts @@ -27,9 +27,11 @@ instance.interceptors.response.use( if (error.response.status === 401 && !originalRequest._retry) { originalRequest._retry = true; try { - const { setMember } = memberStore.getState(); + console.log('hi'); const response = await getNewToken(); const { accessToken } = response.data; + console.log(accessToken); + const { setMember } = memberStore.getState(); setMember(accessToken); originalRequest.headers['Authorization'] = `Bearer ${accessToken}`; return instance(originalRequest); diff --git a/src/pages/signup/components/signupCheck/index.tsx b/src/pages/signup/components/signupCheck/index.tsx index 4b11bad..a9d8790 100644 --- a/src/pages/signup/components/signupCheck/index.tsx +++ b/src/pages/signup/components/signupCheck/index.tsx @@ -2,7 +2,7 @@ import { Timer } from '..'; import { useEffect, useState } from 'react'; import { Button, CircleLoader, InputField } from '@/components'; import usePostEmailVerify from '../../hooks/usePostEmailVerify'; -import { useForm } from 'react-hook-form'; +import { RegisterOptions, useForm } from 'react-hook-form'; import usePostCheckEmailOrNickname, { SignupCheckData, } from '../../hooks/usePostCheckEmailOrNickname'; @@ -13,10 +13,17 @@ export interface SignupCheckProps { label: string; value: 'email' | 'nickname'; buttonLabel: string; + registerOptions: RegisterOptions; successMessage: string; } -const SignupCheck = ({ label, value, buttonLabel, successMessage }: SignupCheckProps) => { +const SignupCheck = ({ + label, + value, + buttonLabel, + successMessage, + registerOptions, +}: SignupCheckProps) => { const { register, formState: { errors }, @@ -34,13 +41,10 @@ const SignupCheck = ({ label, value, buttonLabel, successMessage }: SignupCheckP , + )} error={errors[value]} label={label} value={value} diff --git a/src/pages/signup/components/signupForm/index.tsx b/src/pages/signup/components/signupForm/index.tsx index 8780356..6c151dc 100644 --- a/src/pages/signup/components/signupForm/index.tsx +++ b/src/pages/signup/components/signupForm/index.tsx @@ -1,7 +1,7 @@ import { SignupFormLayout, SignupTextarea } from '..'; import { Button, InputField } from '@/components'; import { ExtendedSignupForm } from '@/types/member'; -import { useFormContext } from 'react-hook-form'; +import { RegisterOptions, useFormContext } from 'react-hook-form'; import { essentiolFormData, optionalFormData } from '@/consts/signup'; import { checkModalStore } from '@/stores/modal'; import { Navigate } from 'react-router-dom'; @@ -50,7 +50,12 @@ const SignupForm = () => { open({ title: props.title, content: ( - + ), }) }