Skip to content

Commit da41f57

Browse files
committed
FEATURE: Optionally configurable application name.
1 parent d555c36 commit da41f57

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Classes/Service/TwoFactorAuthenticationService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ public function validateOtp(Account $account, OneTimePassword $otp): bool
9898
* Generates a QR Code for the configured application name and the specified $holder
9999
* The QR Code can be used to activate 2FA, @see enableTwoFactorAuthentication()
100100
*/
101-
public function generateActivationQrCode(string $holder): ActivationQrCode
101+
public function generateActivationQrCode(string $holder, string $applicationName = ''): ActivationQrCode
102102
{
103103
$secret = $this->generateSecret();
104-
$qrCodeUrl = $this->google2FA->getQRCodeUrl($this->applicationName, $holder, $secret->toString());
104+
$qrCodeUrl = $this->google2FA->getQRCodeUrl($applicationName === '' ? $this->applicationName : $applicationName, $holder, $secret->toString());
105105
return ActivationQrCode::fromSecretAndUrl($secret, $qrCodeUrl);
106106
}
107107

0 commit comments

Comments
 (0)