Fixed 2-factor auth issue

This commit is contained in:
Ylian Saint-Hilaire 2019-11-14 17:39:32 -08:00
parent 944d7a9a9b
commit 3d2974eca0
1 changed files with 1 additions and 1 deletions

View File

@ -3438,7 +3438,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
if ((err == null) && (user)) {
// Check if a 2nd factor is needed
if (checkUserOneTimePasswordRequired(domain, user) == true) {
if (req.query.token) {
if (typeof req.query.token != 'string') {
try { ws.send(JSON.stringify({ action: 'close', cause: 'noauth', msg: 'tokenrequired' })); ws.close(); } catch (e) { }
} else {
checkUserOneTimePassword(req, domain, user, req.query.token, null, function (result) {