mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-09-11 08:55:32 +03:00
Fixed U2F server exception (#4346)
This commit is contained in:
parent
722cb83bf1
commit
2c9fcdbfd0
@ -978,9 +978,8 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
|
|||||||
|
|
||||||
// Return a U2F hardware key challenge
|
// Return a U2F hardware key challenge
|
||||||
function getHardwareKeyChallenge(req, domain, user, func) {
|
function getHardwareKeyChallenge(req, domain, user, func) {
|
||||||
delete req.session.u2f;
|
var sec = {};
|
||||||
if (req.session == null) { req.session = {}; }
|
if (req.session == null) { req.session = {}; } else { try { sec = parent.decryptSessionData(req.session.e); } catch (ex) { } }
|
||||||
const sec = parent.decryptSessionData(req.session.e);
|
|
||||||
|
|
||||||
if (user.otphkeys && (user.otphkeys.length > 0)) {
|
if (user.otphkeys && (user.otphkeys.length > 0)) {
|
||||||
// Get all WebAuthn keys
|
// Get all WebAuthn keys
|
||||||
@ -998,7 +997,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove the chalange if present
|
// Remove the challenge if present
|
||||||
if (sec.u2f != null) { delete sec.u2f; req.session.e = parent.encryptSessionData(sec); }
|
if (sec.u2f != null) { delete sec.u2f; req.session.e = parent.encryptSessionData(sec); }
|
||||||
|
|
||||||
parent.debug('web', 'getHardwareKeyChallenge: fail');
|
parent.debug('web', 'getHardwareKeyChallenge: fail');
|
||||||
|
Loading…
Reference in New Issue
Block a user