mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-24 04:00:59 +01:00
mobile: show error if mfa info not recieved
This commit is contained in:
@@ -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: <TwoFactorVerification onMfaLogin={onMfaLogin} mfaInfo={data} />,
|
||||
component: () => (
|
||||
<TwoFactorVerification onMfaLogin={onMfaLogin} mfaInfo={data} />
|
||||
),
|
||||
context: context || "two_factor_verify",
|
||||
onClose: () => {
|
||||
onMfaLogin();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user