diff --git a/views/default.handlebars b/views/default.handlebars index 2c209821..bb622859 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -12920,7 +12920,6 @@ if (serverinfo.discordUrl) { x += ''; } x += ''; x += ''; - console.log(serverinfo.userMsgNftyUrl); x += ''; x += ''; setDialogMode(2, "Messaging Notifications", 3, account_manageMessagingAdd, x, 'verifyMessaging'); diff --git a/views/default3.handlebars b/views/default3.handlebars index 7240d387..693175c6 100644 --- a/views/default3.handlebars +++ b/views/default3.handlebars @@ -3506,7 +3506,7 @@ var secret = message.secret; if (secret.length == 52) { secret = secret.split(/(.............)/).filter(Boolean).join(' '); } else if (secret.length == 32) { secret = secret.split(/(....)/).filter(Boolean).join(' '); secret = secret.substring(0, 20) + '
' + secret.substring(20) } - QH('d2optinfo', '
' + format("Install" + ' ' + "Google Authenticator" + ' ' + "or a compatible application and scan the barcode, use this link or enter the secret. Then, enter the current 6 digit token below to activate 2-Step login.", message.url) + '

' + 'Secret ' + '
' + secret + '


' + "Enter the token here for 2-step login:" + '
'); + QH('d2optinfo', '
' + format("Install" + ' ' + "Google Authenticator" + ' ' + "or a compatible application and scan the barcode, use this link or enter the secret. Then, enter the current 6 digit token below to activate 2-Step login.", message.url) + '

' + 'Secret ' + '
' + secret + '


' + "Enter the token here for 2-step login:" + '
'); new QRCode(Q('qrcode'), { text: message.url, width: 128, height: 128, colorDark: '#000000', colorLight: '#EEE', correctLevel: QRCode.CorrectLevel.H }); QV('idx_dlgOkButton', true); QE('idx_dlgOkButton', false); @@ -3528,7 +3528,7 @@ break; } case 'otpauth-getpasswords': { - if (xxdialogMode) return; + if (xxdialogMode == 2 && (xxdialogTag != 'otpauth-manage')) return; var x = "One time tokens can be used as secondary authentication. Generate a set, print them and keep them in a safe place."; x += '
'; if (message.passwords) { @@ -3549,13 +3549,15 @@ x += '
' + "No Active Tokens"; } x += '

'; - x += '
'; - x += ''; + x += '
'; + x += '
'; + x += ' '; + } else { + x += '
' } - x += '
'; + xxdialogTag = 'otpauth-manage'; setModalContent('xxAddAgent', "Manage Backup Codes", x); showModal('xxAddAgentModal', 'idx_dlgOkButton'); break; @@ -3569,7 +3571,7 @@ if (message.keys && message.keys.length > 0) { for (var i in message.keys) { var key = message.keys[i], type = (key.type == 2) ? 'OTP' : 'WebAuthn'; - x += start + '' + key.name + '' + end; + x += start + '' + key.name + '' + end; } } else { x += start + '' + "No Keys Configured" + end; @@ -3578,12 +3580,13 @@ x += '
'; var hkeycount = (typeof userinfo.otphkeys == 'number') ? userinfo.otphkeys : 0; if ((typeof serverinfo.maxfidokeys != 'number') || (serverinfo.maxfidokeys > hkeycount)) { // Check if we we reached maximum hardware keys - if ((features & 0x00020000) != 0) { x += ''; } - if ((features & 0x00004000) != 0) { x += ''; } + if ((features & 0x00020000) != 0) { x += '

'; + xxdialogTag = 'otpauth-hardware-manage'; setModalContent('xxAddAgent', "Manage Security Keys", x); showModal('xxAddAgentModal', 'idx_dlgOkButton'); if (u2fSupported() == false) { QE('d2addkey1', false); } @@ -3619,7 +3622,6 @@ navigator.credentials.create({ publicKey: publicKey }).then(function (newCredentialInfo) { // Public key credential meshserver.send({ action: 'webauthn-endregister', response: { rawId: btoa(String.fromCharCode.apply(null, new Uint8Array(newCredentialInfo.rawId))), response: { attestationObject: btoa(String.fromCharCode.apply(null, new Uint8Array(newCredentialInfo.response.attestationObject))), clientDataJSON: btoa(String.fromCharCode.apply(null, new Uint8Array(newCredentialInfo.response.clientDataJSON))) }, type: newCredentialInfo.type } }); - setDialogMode(0); }, function (error) { // Error console.log("ERROR: " + error); @@ -13764,12 +13766,11 @@ if (serverinfo.discordUrl) { x += ''; } x += ''; x += ''; - console.log(serverinfo.userMsgNftyUrl); x += ''; x += ''; xxdialogTag = 'VerifyMessaging'; setModalContent('xxAddAgent', "Messaging Notifications", x); - showModal('xxAddAgentModal', 'idx_dlgOkButton', account_manageMessagingAdd()); + showModal('xxAddAgentModal', 'idx_dlgOkButton', () => account_manageMessagingAdd()); Q('d2handleinput').focus(); account_manageMessagingValidate(); } @@ -13791,7 +13792,7 @@ else { Q('d2handleinput')['placeholder'] = "Username"; } var ok = (Q('d2handleinput').value.length > 0); QE('idx_dlgOkButton', ok); if ((x == 1) && ok) { dialogclose(1); } } - function account_manageMessagingAdd() { if (Q('d2handleinput').value.length == 0) return; QE('d2handleinput', false); meshserver.send({ action: 'verifyMessaging', service: Q('d2serviceselect').value, handle: Q('d2handleinput').value }); } + function account_manageMessagingAdd() { if (Q('d2handleinput').value.length == 0) return; QE('d2handleinput', false); meshserver.send({ action: 'verifyMessaging', service: Q('d2serviceselect').value, handle: Q('d2handleinput').value }); return false; } function account_manageMessagingConfirm(b, tag) { meshserver.send({ action: 'confirmMessaging', code: Q('d2phoneCodeInput').value, cookie: tag }); } function account_manageMessagingRemove() { if (Q('d2delPhone').checked) { meshserver.send({ action: 'removeMessaging' }); } } @@ -13835,7 +13836,7 @@ if (xxdialogMode || (userinfo.otpsecret == 1) || ((features & 4096) == 0)) return; xxdialogTag = 'otpauth-request'; setModalContent('xxAddAgent', "Authenticator App", ('
' + "Loading..." + '
')); - showModal('xxAddAgentModal', 'idx_dlgOkButton', function () { meshserver.send({ action: 'otpauth-setup', secret: Q('d2optsecret').attributes.secret.value, token: Q('d2otpauthinput').value }); }); + showModal('xxAddAgentModal', 'idx_dlgOkButton', function () { meshserver.send({ action: 'otpauth-setup', secret: Q('d2optsecret').attributes.secret.value, token: Q('d2otpauthinput').value }); return false; }); meshserver.send({ action: 'otpauth-request' }); } @@ -13852,8 +13853,7 @@ } function account_manageOtp(action) { - if ((xxdialogMode == 2) && (xxdialogTag == 'otpauth-manage')) { dialogclose(0); } - if (xxdialogMode || ((features & 4096) == 0)) return false; + if ((features & 4096) == 0) return false; if (count2factoraAuths() > 0) { meshserver.send({ action: 'otpauth-getpasswords', subaction: action }); } return false; } @@ -13921,6 +13921,7 @@ showModal('xxAddAgentModal', 'idx_dlgOkButton'); } else if (type == 3) { meshserver.send({ action: 'webauthn-startregister', name: name }); + return false; } }