Added 2FA backup code link in desktop app.

Ylian Saint-Hilaire committed Sep 2, 2021 at 14:33 UTC 2bdf6ce6af7df7153b12a27f15df2ac660e41105
1 file changed +3 -2
views/default.handlebars
+3 -2
@@ -2093,7 +2093,7 @@
2093
2094 // Check if none or at least 2 factors are enabled.
2095 if ((backupCodesWarningDone == false) && (authFactorCount == 1)) {
2096 - addNotification({ text: "Please add two-factor backup codes. If the current factor is lost, there is no way to recover this account.", title: "Two factor authentication" });
2096 + addNotification({ text: "Please add two-factor backup codes. If the current factor is lost, there is no way to recover this account.", title: "Two factor authentication", tag: 'backupcodes' });
2097 backupCodesWarningDone = true;
2098 }
2099
@@ -14941,7 +14941,8 @@
14941 else if (n.tag == 'console') gotoDevice(n.nodeid, 15); // Files
14942 else gotoDevice(n.nodeid, 10); // General
14943 } else {
14944 - if ((n.tag != null) && n.tag.startsWith('meshmessenger/')) {
14944 + if ((n.tag == 'backupcodes') && !xxdialogMode) { go(2); account_manageOtp(0); notificationDelete(id); } // 2FA backup codes
14945 + else if ((n.tag != null) && n.tag.startsWith('meshmessenger/')) {
14946 safeNewWindow('/messenger?id=' + n.tag + '&title=' + encodeURIComponentEx(n.username), n.tag.split('/')[2]);
14947 notificationDelete(id);
14948 } else if (n.url != null) {