From 159773744c6978c8dfdfca73a98426e12d3313e2 Mon Sep 17 00:00:00 2001 From: Emanuele Panzeri Date: Mon, 23 Feb 2026 15:31:31 +0100 Subject: [PATCH] Align TOTP configuration on Attributes/Annotations examples This also makes the examples of TOTP configuration compatible with Google-Authenticator (digits:6, period: 30) --- doc/providers/totp.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/providers/totp.rst b/doc/providers/totp.rst index 102cb1a8..f857512c 100644 --- a/doc/providers/totp.rst +++ b/doc/providers/totp.rst @@ -94,7 +94,7 @@ and the period of the temporary codes. public function getTotpAuthenticationConfiguration(): ?TotpConfigurationInterface { // You could persist the other configuration options in the user entity to make it individual per user. - $period = 20; + $period = 30; $digits = 6; return null !== $this->totpSecret ? new TotpConfiguration($this->totpSecret, TotpConfiguration::ALGORITHM_SHA1, $period, $digits) : null; } @@ -132,7 +132,9 @@ and the period of the temporary codes. public function getTotpAuthenticationConfiguration(): ?TotpConfigurationInterface { // You could persist the other configuration options in the user entity to make it individual per user. - return new TotpConfiguration($this->totpSecret, TotpConfiguration::ALGORITHM_SHA1, 20, 8); + $period = 30; + $digits = 6; + return null !== $this->totpSecret ? new TotpConfiguration($this->totpSecret, TotpConfiguration::ALGORITHM_SHA1, $period, $digits) : null; } }