Fixed server crash in login request.

This commit is contained in:
Ylian Saint-Hilaire 2020-04-21 11:13:41 -07:00
parent 48f78aa6ca
commit 94662c9b77

View File

@ -1933,7 +1933,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
if (hardwareKeyChallenge) { hwstate = obj.parent.encodeCookie({ u: req.session.tokenusername, p: req.session.tokenpassword, c: req.session.u2fchallenge }, obj.parent.loginCookieEncryptionKey) }
// Check if we can use OTP tokens with email
var otpemail = (parent.mailserver != null) && (req.session.tokenemail);
var otpemail = (parent.mailserver != null) && (req.session != null) && (req.session.tokenemail != null);
if ((typeof domain.passwordrequirements == 'object') && (domain.passwordrequirements.email2factor == false)) { otpemail = false; }
// Render the login page