add 2fa at session expired

This commit is contained in:
ammarahm-ed
2022-03-23 17:49:01 +05:00
parent 88a10071e7
commit f38d940f01

View File

@@ -131,12 +131,16 @@ export const SessionExpired = () => {
paragraph: 'Please wait while we sync all your data.', paragraph: 'Please wait while we sync all your data.',
progress: true progress: true
}); });
setLoading(false);
} catch (e) { } catch (e) {
callback && callback(true); callback && callback(false);
if (e.message === 'MFA Required') { if (e.message === 'Multifactor authentication required.') {
TwoFactorVerification.present(async mfa => { TwoFactorVerification.present(async mfa => {
if (mfa) { if (mfa) {
console.log(mfa);
await login(mfa); await login(mfa);
} else {
setLoading(false);
} }
}, e.data); }, e.data);
} else { } else {