fix: can redirect to password form from otp form

This commit is contained in:
Sajad Mirjalili
2025-09-26 17:06:29 +03:30
parent 7d490cb084
commit 315fadb7e1
5 changed files with 41 additions and 16 deletions

View File

@@ -30,6 +30,7 @@ export const AuthenticationSteps = (): JSX.Element => {
const [addedPhoneNumberValue, setAddedPhoneNumberValue] =
useState<string>('');
const [memoryTokenRes, setMemoryTokenRes] = useState<GenerateTokenResponse>();
const [hasPassword, setHasPassword] = useState(false);
const { login } = useAuth();
const authFactory: AuthFactory = useMemo(() => {
@@ -83,6 +84,7 @@ export const AuthenticationSteps = (): JSX.Element => {
case UserStatus.RegisteredWithPassword:
setAuthMode('login');
setCurrentStep('enterPassword');
setHasPassword(true);
break;
}
@@ -165,6 +167,8 @@ export const AuthenticationSteps = (): JSX.Element => {
authMode={authMode}
authType={authType}
value={loginRegisterValue}
hasPassword={hasPassword}
onLoginWithPassword={() => setCurrentStep('enterPassword')}
/>
)}