A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
feat: add support for adding fallback 2fa method
thecodrrea6f8fe121cc
diff --git a/packages/core/api/mfa-manager.js b/packages/core/api/mfa-manager.jsindex f1c309599..c879c9701 100644--- a/packages/core/api/mfa-manager.js+++ b/packages/core/api/mfa-manager.js@@ -47,11 +47,33 @@ class MFAManager {* @returns*/async enable(type, code) {+ return this._enable(type, code, false);+ }++ /**+ *+ * @param {"app" | "sms" | "email"} type+ * @param {string} code+ * @returns+ */+ async enableFallback(type, code) {+ return this._enable(type, code);+ }++ /**+ *+ * @param {"app" | "sms" | "email"} type+ * @param {string} code+ * @param {boolean} isFallback+ * @private+ * @returns+ */+ async _enable(type, code, isFallback) {const token = await this.tokenManager.getAccessToken();if (!token) return;return await http.post(`${constants.AUTH_HOST}${ENDPOINTS.enable}`,- { type, code },+ { type, code, isFallback },token);}