Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: allow changing primary 2fa method

Abdullah Atta4a2defa30039
diff --git a/apps/web/src/dialogs/settings/auth-settings.ts b/apps/web/src/dialogs/settings/auth-settings.ts
index 7acab46a7..4c4f84c1e 100644
--- a/apps/web/src/dialogs/settings/auth-settings.ts
+++ b/apps/web/src/dialogs/settings/auth-settings.ts
@@ -76,6 +76,26 @@ export const AuthenticationSettings: SettingsGroup[] = [
keywords: [],
components: []
},
+ {
+ key: "primary-2fa-method",
+ title: "Primary method",
+ keywords: ["primary 2fa method"],
+ onStateChange: (listener) =>
+ useUserStore.subscribe((s) => s.user?.mfa.primaryMethod, listener),
+ components: [
+ {
+ type: "button",
+ title: "Change",
+ action: async () => {
+ if (await verifyAccount()) {
+ await showMultifactorDialog();
+ await useUserStore.getState().refreshUser();
+ }
+ },
+ variant: "primary"
+ }
+ ]
+ },
{
key: "fallback-2fa-method",
title: "Fallback method",