Skip to content

Commit 2bbfe62

Browse files
committed
Show only secret instead of whole otpauth url
This is more user friendly, because most authenticator apps just want the secret for manual creation.
1 parent d4966f8 commit 2bbfe62

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

application/forms/Account/TwoFactorConfigForm.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,16 @@ protected function assemble(): void
135135
. ' authentication in case you lose access to your device.')
136136
));
137137

138-
$manualAuthUrl = HtmlElement::create(
138+
$manualSecret = HtmlElement::create(
139139
'div',
140-
Attributes::create(['class' => 'two-factor-totp-auth-url']),
141-
new Text($this->twoFactor->getTotpAuthUrl()),
140+
Attributes::create(['class' => 'two-factor-manual-secret']),
141+
new Text($this->twoFactor->getSecret()),
142142
);
143-
CopyToClipboard::attachTo($manualAuthUrl);
143+
CopyToClipboard::attachTo($manualSecret);
144144
$this->addHtml(new FakeFormElement(
145-
$manualAuthUrl,
146-
$this->translate('Manual Auth URL'),
147-
$this->translate('If you have no camera to scan the QR code you can enter the auth URL manually.')
145+
$manualSecret,
146+
$this->translate('Manual Secret'),
147+
$this->translate('If you have no camera to scan the QR code you can enter the secret manually.')
148148
));
149149

150150
$this->addElement(

public/css/icinga/forms.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ form.icinga-form .form-info {
611611
height: 20em;
612612
}
613613

614-
.two-factor-totp-auth-url {
614+
.two-factor-manual-secret {
615615
background-color: @base-disabled;
616616
padding: @vertical-padding;
617617
border-radius: .25em;

0 commit comments

Comments
 (0)