From 5126c5a1ef1b6fec162c2af2784131e6408f6e8f Mon Sep 17 00:00:00 2001 From: Simon Smith Date: Fri, 6 Oct 2023 17:36:41 +0000 Subject: [PATCH] add copy button to secret totp Signed-off-by: Simon Smith --- views/default.handlebars | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/views/default.handlebars b/views/default.handlebars index 6e4ac0b0..985f1d26 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -2855,7 +2855,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); @@ -5281,6 +5281,8 @@ function d2CopyInviteToClip() { copyTextToClip(Q('agentInvitationLink').href); } + function d2CopySecretToClip() { copyTextToClip(Q('d2optsecret').getAttribute('secret')); } + function validateAgentInvite() { if ((features & 64) && (Q('d2InviteType').value == 1)) { QE('idx_dlgOkButton', checkEmail(Q('agentInviteEmail').value));