mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Update src/routes/(console)/account/updateMfa.svelte
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
106d48c897
commit
62f8d3f1c4
1 file changed
+5
-1
@@ -80,11 +80,15 @@
|
||||
await sdk.forConsole.account.updateMFA({ mfa: !$user.mfa });
|
||||
|
||||
if (!$user.mfa && $user.emailVerification && !$factors.email) {
|
||||
// Automatically set up email MFA when enabling MFA if the user has a verified email
|
||||
// This provides a fallback authentication method without requiring user interaction
|
||||
try {
|
||||
await sdk.forConsole.account.createMFAChallenge({
|
||||
factor: AuthenticationFactor.Email
|
||||
});
|
||||
} catch (emailError) {}
|
||||
} catch (emailError) {
|
||||
// Silently ignore - email MFA is optional and shouldn't block MFA enablement
|
||||
}
|
||||
}
|
||||
|
||||
await Promise.all([invalidate(Dependencies.ACCOUNT), invalidate(Dependencies.FACTORS)]);
|
||||
|
||||
Reference in new issue
Block a user