diff --git a/apps/mobile/app/components/auth/two-factor.js b/apps/mobile/app/components/auth/two-factor.js index 7bef92c4b..bc9e2c12b 100644 --- a/apps/mobile/app/components/auth/two-factor.js +++ b/apps/mobile/app/components/auth/two-factor.js @@ -205,7 +205,9 @@ const TwoFactorVerification = ({ onMfaLogin, mfaInfo }) => { : "xxxxxx" } testID={"input.totp"} - maxLength={currentMethod.method === "recoveryCode" ? undefined : 6} + maxLength={ + currentMethod.method === "recoveryCode" ? undefined : 6 + } fwdRef={inputRef} textAlign="center" onChangeText={(value) => { @@ -300,7 +302,9 @@ const TwoFactorVerification = ({ onMfaLogin, mfaInfo }) => { TwoFactorVerification.present = (onMfaLogin, data, context) => { presentSheet({ - component: , + component: () => ( + + ), context: context || "two_factor_verify", onClose: () => { onMfaLogin(); diff --git a/apps/mobile/app/components/auth/use-login.js b/apps/mobile/app/components/auth/use-login.js index b329c9f51..84393efec 100644 --- a/apps/mobile/app/components/auth/use-login.js +++ b/apps/mobile/app/components/auth/use-login.js @@ -75,7 +75,7 @@ export const useLogin = (onFinishLogin) => { mfa.code, mfa.method ); - + if (success) { setStep(LoginSteps.passwordAuth); setLoading(false); @@ -94,6 +94,8 @@ export const useLogin = (onFinishLogin) => { } } }, mfaInfo); + } else { + finishWithError(new Error("Unable to send 2FA code")); } break; }