diff --git a/packages/ui/src/containers/VerificationCode/use-identifier-error-alert.ts b/packages/ui/src/containers/VerificationCode/use-identifier-error-alert.ts index 240bd666b..746da80a8 100644 --- a/packages/ui/src/containers/VerificationCode/use-identifier-error-alert.ts +++ b/packages/ui/src/containers/VerificationCode/use-identifier-error-alert.ts @@ -5,6 +5,7 @@ import { useNavigate } from 'react-router-dom'; import { useConfirmModal } from '@/hooks/use-confirm-modal'; import type { VerificationCodeIdentifier } from '@/types'; +import { formatPhoneNumberWithCountryCallingCode } from '@/utils/country-code'; export enum IdentifierErrorType { IdentifierNotExist = 'IdentifierNotExist', @@ -33,7 +34,10 @@ const useIdentifierErrorAlert = () => { type: t( `description.${identifierType === SignInIdentifier.Email ? 'email' : 'phone_number'}` ), - identifier, + identifier: + identifierType === SignInIdentifier.Email + ? identifier + : formatPhoneNumberWithCountryCallingCode(identifier), } ), cancelText: 'action.got_it', diff --git a/packages/ui/src/containers/VerificationCode/use-register-flow-code-verification.ts b/packages/ui/src/containers/VerificationCode/use-register-flow-code-verification.ts index e33cde0c2..27d3118c7 100644 --- a/packages/ui/src/containers/VerificationCode/use-register-flow-code-verification.ts +++ b/packages/ui/src/containers/VerificationCode/use-register-flow-code-verification.ts @@ -14,6 +14,7 @@ import { useConfirmModal } from '@/hooks/use-confirm-modal'; import useRequiredProfileErrorHandler from '@/hooks/use-required-profile-error-handler'; import { useSieMethods } from '@/hooks/use-sie'; import type { VerificationCodeIdentifier } from '@/types'; +import { formatPhoneNumberWithCountryCallingCode } from '@/utils/country-code'; import useGeneralVerificationCodeErrorHandler from './use-general-verification-code-error-handler'; import useIdentifierErrorAlert, { IdentifierErrorType } from './use-identifier-error-alert'; @@ -52,7 +53,10 @@ const useRegisterFlowCodeVerification = ( confirmText: 'action.sign_in', ModalContent: t('description.create_account_id_exists', { type: t(`description.${method === SignInIdentifier.Email ? 'email' : 'phone_number'}`), - value: target, + value: + method === SignInIdentifier.Email + ? target + : formatPhoneNumberWithCountryCallingCode(target), }), }); diff --git a/packages/ui/src/containers/VerificationCode/use-sign-in-flow-code-verification.ts b/packages/ui/src/containers/VerificationCode/use-sign-in-flow-code-verification.ts index f422cf79c..6b31f6fe1 100644 --- a/packages/ui/src/containers/VerificationCode/use-sign-in-flow-code-verification.ts +++ b/packages/ui/src/containers/VerificationCode/use-sign-in-flow-code-verification.ts @@ -16,6 +16,7 @@ import { useSieMethods } from '@/hooks/use-sie'; import type { VerificationCodeIdentifier } from '@/types'; import { SearchParameters } from '@/types'; import { getSearchParameters } from '@/utils'; +import { formatPhoneNumberWithCountryCallingCode } from '@/utils/country-code'; import useGeneralVerificationCodeErrorHandler from './use-general-verification-code-error-handler'; import useIdentifierErrorAlert, { IdentifierErrorType } from './use-identifier-error-alert'; @@ -57,7 +58,10 @@ const useSignInFlowCodeVerification = ( confirmText: 'action.create', ModalContent: t('description.sign_in_id_does_not_exist', { ype: t(`description.${method === SignInIdentifier.Email ? 'email' : 'phone_number'}`), - value: target, + value: + method === SignInIdentifier.Email + ? target + : formatPhoneNumberWithCountryCallingCode(target), }), });