Fixed TouchID on mobile, 404 page when using loginkey.

This commit is contained in:
Ylian Saint-Hilaire 2020-02-27 12:55:14 -08:00
parent 7679f990a4
commit 7a5cfee309
3 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "meshcentral",
"version": "0.4.9-j",
"version": "0.4.9-l",
"keywords": [
"Remote Management",
"Intel AMT",

View File

@ -338,7 +338,7 @@
publicKeyCredentialRequestOptions = { challenge: hardwareKeyChallenge.challenge, allowCredentials: [], timeout: hardwareKeyChallenge.timeout }
for (var i = 0; i < hardwareKeyChallenge.keyIds.length; i++) {
publicKeyCredentialRequestOptions.allowCredentials.push(
{ id: Uint8Array.from(atob(hardwareKeyChallenge.keyIds[i]), function (c) { return c.charCodeAt(0) }), type: 'public-key', transports: ['usb', 'ble', 'nfc'], }
{ id: Uint8Array.from(atob(hardwareKeyChallenge.keyIds[i]), function (c) { return c.charCodeAt(0) }), type: 'public-key', transports: ['usb', 'ble', 'nfc', 'internal'], }
);
}

View File

@ -3650,6 +3650,8 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
obj.app.use(function (req, res, next) {
parent.debug('web', '404 Error ' + req.url);
var domain = getDomain(req);
if ((domain == null) || (domain.auth == 'sspi')) { res.sendStatus(404); return; }
if ((domain.loginkey != null) && (domain.loginkey.indexOf(req.query.key) == -1)) { res.sendStatus(404); return; } // Check 3FA URL key
res.status(404).render(getRenderPage('error404', req), getRenderArgs({}, domain));
});
}