Fixed notifications that had html codes.

Ylian Saint-Hilaire committed Jul 15, 2020 at 13:25 UTC be6ec894e39ad9215352cda3743792321cc4a893
3 files changed +3 -4
meshuser.js
+1 -1
@@ -1387,7 +1387,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
1387 db.GetUserWithVerifiedEmail(domain.id, command.email, function (err, docs) {
1388 if ((docs != null) && (docs.length > 0)) {
1389 // Notify the duplicate email error
1390 - try { ws.send(JSON.stringify({ action: 'msg', type: 'notify', title: 'Account Settings', id: Math.random(), tag: 'ServerNotify', value: 'Failed to change email address, another account already using: <b>' + EscapeHtml(command.email) + '</b>.' })); } catch (ex) { }
1390 + try { ws.send(JSON.stringify({ action: 'msg', type: 'notify', title: 'Account Settings', id: Math.random(), tag: 'ServerNotify', value: 'Failed to change email address, another account already using: ' + command.email + '.' })); } catch (ex) { }
1391 } else {
1392 // Update the user's email
1393 var oldemail = user.email;
views/default.handlebars
+1 -2
@@ -1881,8 +1881,7 @@
1881
1882 // Check if none or at least 2 factors are enabled.
1883 if ((backupCodesWarningDone == false) && (authFactorCount == 1)) {
1884 - var n = { text: "Please add two-factor backup codes. If the current factor is lost, there is not way to recover this account.", title: "Two factor authentication" };
1885 - addNotification(n);
1884 + addNotification({ text: "Please add two-factor backup codes. If the current factor is lost, there is not way to recover this account.", title: "Two factor authentication" });
1885 backupCodesWarningDone = true;
1886 }
1887
webserver.js
+1 -1
@@ -1552,7 +1552,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
1552 render(req, res, getRenderPage('message', req, domain), getRenderArgs({ titleid: 1, msgid: 6, domainurl: encodeURIComponent(domain.url).replace(/'/g, '%27'), arg1: encodeURIComponent(user.email).replace(/'/g, '%27'), arg2: encodeURIComponent(user.name).replace(/'/g, '%27') }, req, domain));
1553
1554 // Send a notification
1555 - obj.parent.DispatchEvent([user._id], obj, { action: 'notify', value: 'Email verified:<br /><b>' + EscapeHtml(user.email) + '</b>.', nolog: 1, id: Math.random() });
1555 + obj.parent.DispatchEvent([user._id], obj, { action: 'notify', title: 'Email verified', value: user.email, nolog: 1, id: Math.random() });
1556
1557 // Send to authlog
1558 if (obj.parent.authlog) { obj.parent.authLog('https', 'Verified email address ' + user.email + ' for user ' + user.name); }