diff --git a/src/api/types/auth.ts b/src/api/types/auth.ts index 3859a66..6cb7d89 100644 --- a/src/api/types/auth.ts +++ b/src/api/types/auth.ts @@ -24,7 +24,7 @@ export interface IPhoneNumber { } export interface IPhoneAuth extends IPhoneNumber { - code: number; + code: string; } export interface IUserInfo { @@ -43,12 +43,12 @@ export interface IEmail { emailAddress: string; } export interface IEmailAuth extends IEmail { - code: number; + code: string; } export interface IEmailAuth2 { emailAddress: string; - code: number; + code: string; } export interface ITokenRefresh { diff --git a/src/components/findpassword/EmailCertification.tsx b/src/components/findpassword/EmailCertification.tsx index 6b61aeb..6b9749c 100644 --- a/src/components/findpassword/EmailCertification.tsx +++ b/src/components/findpassword/EmailCertification.tsx @@ -28,7 +28,7 @@ const EmailCertification = ({ setStep }: EmailCertificationProps) => { }); const { mutateAsync: emailVerify } = useMutation( - ({ emailAddress, code }: { emailAddress: string; code: number }) => { + ({ emailAddress, code }: { emailAddress: string; code: string }) => { return emailauthverify({ emailAddress, code }); } ); @@ -117,7 +117,7 @@ const EmailCertification = ({ setStep }: EmailCertificationProps) => { try { const { status } = (await emailVerify({ emailAddress: userEmail, - code: Number(validNumber) + code: validNumber })) as { status: string }; if (status == 'SUCCESS') { diff --git a/src/components/signup/EmailVerification.tsx b/src/components/signup/EmailVerification.tsx index d6ac11a..7e3cde5 100644 --- a/src/components/signup/EmailVerification.tsx +++ b/src/components/signup/EmailVerification.tsx @@ -31,7 +31,7 @@ const EmailVerification = ({ onNext }: EmailVerification) => { }); const { mutateAsync: emailVerify } = useMutation( - ({ emailAddress, code }: { emailAddress: string; code: number }) => { + ({ emailAddress, code }: { emailAddress: string; code: string }) => { return emailauthverify({ emailAddress, code }); } ); @@ -80,7 +80,7 @@ const EmailVerification = ({ onNext }: EmailVerification) => { try { const { status } = (await emailVerify({ emailAddress: userEmail, - code: Number(validNumber) + code: validNumber })) as { status: string }; if (status == 'SUCCESS') { diff --git a/src/components/signup/PhoneCertification.tsx b/src/components/signup/PhoneCertification.tsx index b1a30fe..5a96f0c 100644 --- a/src/components/signup/PhoneCertification.tsx +++ b/src/components/signup/PhoneCertification.tsx @@ -30,7 +30,7 @@ const PhoneCertification = ({ onNext }: PhoneCertificationProps) => { }); const { mutateAsync: phoneVerify } = useMutation( - ({ phoneNumber, code }: { phoneNumber: string; code: number }) => { + ({ phoneNumber, code }: { phoneNumber: string; code:string }) => { return phoneauthverify({ phoneNumber, code }); } ); @@ -114,6 +114,8 @@ const PhoneCertification = ({ onNext }: PhoneCertificationProps) => { if (btnStatus == 'THIRD') { if (validNumber.length != 6) { + console.log(validNumber) + setValidNumber(''); setErrorMessage('6자리 코드를 입력해주세요.'); inputRef.current?.focus(); @@ -122,7 +124,7 @@ const PhoneCertification = ({ onNext }: PhoneCertificationProps) => { try { const { status } = await phoneVerify({ phoneNumber: phoneNumber.replace(/-/g, ''), - code: Number(validNumber) + code: validNumber }); if (status == 'SUCCESS') { @@ -134,6 +136,9 @@ const PhoneCertification = ({ onNext }: PhoneCertificationProps) => { const select = signError.find((item) => item.errorCode === errorCode); if (select) { setErrorMessage(select.message); + console.log(validNumber); + console.log(parseInt(validNumber, 10)); + console.log(Number(validNumber)); setValidNumber(''); inputRef.current?.focus(); return;