mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-11-07 12:52:54 -05:00
Added 2FA timeout on login screen, default is 5 minutes.
This commit is contained in:
@@ -325,6 +325,7 @@
|
||||
var otpsms = (decodeURIComponent('{{{otpsms}}}') === 'true');
|
||||
var twoFactorCookieDays = parseInt('{{{twoFactorCookieDays}}}');
|
||||
var authStrategies = '{{{authStrategies}}}'.split(',');
|
||||
var tokenTimeout = parseInt('{{{tokenTimeout}}}');
|
||||
|
||||
function startup() {
|
||||
// Display the right server message
|
||||
@@ -432,6 +433,7 @@
|
||||
QV('hrAccountDiv', (emailCheck == 'true') || (newAccountPass == 1));
|
||||
|
||||
if (loginMode == '4') {
|
||||
if (tokenTimeout > 0) { setTimeout(function () { Q('hwtokenInput').value = '**timeout**'; QE('tokenOkButton', true); Q('tokenOkButton').click(); }, tokenTimeout); }
|
||||
try { if (hardwareKeyChallenge.length > 0) { hardwareKeyChallenge = JSON.parse(hardwareKeyChallenge); } else { hardwareKeyChallenge = null; } } catch (ex) { hardwareKeyChallenge = null }
|
||||
QV('securityKeyButton', (hardwareKeyChallenge != null) && (hardwareKeyChallenge.type == 'webAuthn'));
|
||||
QV('emailKeyButton', otpemail && (messageid != 2) && (messageid != 4));
|
||||
@@ -439,6 +441,7 @@
|
||||
}
|
||||
|
||||
if (loginMode == '5') {
|
||||
if (tokenTimeout > 0) { setTimeout(function () { Q('hwtokenInput').value = '**timeout**'; QE('tokenOkButton', true); Q('tokenOkButton').click(); }, tokenTimeout); }
|
||||
try { if (hardwareKeyChallenge.length > 0) { hardwareKeyChallenge = JSON.parse(hardwareKeyChallenge); } else { hardwareKeyChallenge = null; } } catch (ex) { hardwareKeyChallenge = null }
|
||||
QV('securityKeyButton2', (hardwareKeyChallenge != null) && (hardwareKeyChallenge.type == 'webAuthn'));
|
||||
QV('emailKeyButton2', otpemail && (messageid != 2) && (messageid != 4));
|
||||
|
||||
Reference in New Issue
Block a user