Fix for UTF8 in OTP QR code, #3745

This commit is contained in:
Ylian Saint-Hilaire 2022-03-08 12:28:11 -08:00
parent b57ed96c48
commit 7dd6fa0c6b

View File

@ -3208,7 +3208,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
var domainName = parent.certificates.CommonName;
if (domain.dns != null) { domainName = domain.dns; }
ws.send(JSON.stringify({ action: 'otpauth-request', secret: secret, url: otplib.authenticator.keyuri(user.name, domainName, secret) }));
ws.send(JSON.stringify({ action: 'otpauth-request', secret: secret, url: otplib.authenticator.keyuri(encodeURIComponent(user.name), domainName, secret) }));
}
break;
}