feat: complete sign up apis added
This commit is contained in:
@@ -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}
|
||||
/>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user