feat: complete sign up apis added

This commit is contained in:
مهرزاد قدرتی
2025-08-11 14:19:32 +03:30
parent 1584b7d7a8
commit b8f7221780
4 changed files with 102 additions and 55 deletions

View File

@@ -31,6 +31,8 @@ export const AuthenticationSteps = (): JSX.Element => {
>('emailOrPhone');
const [loginRegisterValue, setLoginRegisterValue] = useState<string>('');
const [countryCode, setCountryCode] = useState<CountryCode>('+98');
const [addPhoneCountryCode, setAddPhoneCountryCode] =
useState<CountryCode>('+98');
const [addedPhoneNumberValue, setAddedPhoneNumberValue] =
useState<string>('');
@@ -57,14 +59,7 @@ export const AuthenticationSteps = (): JSX.Element => {
}
};
const handleOTPVerfied = (
registeredWithoutPhoneNumber: boolean = false,
userId: GUID,
) => {
if (registeredWithoutPhoneNumber) {
setCurrentStep('addPhoneNumber');
}
const handleOTPVerfied = (userId: GUID) => {
handleUserLoggedIn(userId);
};
@@ -92,6 +87,7 @@ export const AuthenticationSteps = (): JSX.Element => {
{currentStep === 'verify' && (
<OtpVerifyForm
onVerifyPhoneNumber={() => setCurrentStep('addPhoneNumber')}
authReturnUrl={authReturnUrl}
countryCode={countryCode}
onOTPVerified={handleOTPVerfied}
@@ -117,6 +113,8 @@ export const AuthenticationSteps = (): JSX.Element => {
{currentStep === 'addPhoneNumber' && (
<CompleteSignUp
countryCode={addPhoneCountryCode}
setCountryCode={setAddPhoneCountryCode}
value={addedPhoneNumberValue}
setValue={setAddedPhoneNumberValue}
email={loginRegisterValue}
@@ -126,9 +124,11 @@ export const AuthenticationSteps = (): JSX.Element => {
{currentStep === 'addedPhoneNumberVerify' && (
<VerifyPhoneNumber
authReturnUrl={authReturnUrl}
countryCode={countryCode}
onEditValue={() => setCurrentStep('emailOrPhone')}
onEditValue={() => setCurrentStep('addPhoneNumber')}
value={addedPhoneNumberValue}
email={loginRegisterValue}
onPhoneNumberVerified={handleUserLoggedIn}
/>
)}