mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-12 11:01:52 +00:00
Fixed 2FA server crash.
This commit is contained in:
parent
f9e6d023db
commit
92b00d29a2
1 changed files with 1 additions and 1 deletions
|
@ -724,7 +724,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
|
|||
if ((typeof domain.passwordrequirements == 'object') && (domain.passwordrequirements.sms2factor == false)) { otpsms = false; }
|
||||
|
||||
// Check 2FA login cookie
|
||||
if (token.startsWith('cookie=')) {
|
||||
if ((token != null) && (token.startsWith('cookie='))) {
|
||||
var twoFactorCookie = obj.parent.decodeCookie(decodeURIComponent(token.substring(7)), obj.parent.loginCookieEncryptionKey, (30 * 24 * 60)); // If the cookies does not have an expire feild, assume 30 day timeout.
|
||||
if ((twoFactorCookie != null) && ((obj.args.cookieipcheck === false) || (twoFactorCookie.ip == null) || (twoFactorCookie.ip === req.clientIp)) && (twoFactorCookie.userid == user._id)) { func(true); return; }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue