Bug 30842: 2FA - Allow at least one old TOTP
We allow one old token when we are setting the two-factor auth, we should reuse the same settings when validation the authentication itself. Test plan: Setup 2FA for your logged-in user Logout/Login Have a look at the code and wait for 30 sec before using it (< 1min however) Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
17b7ae56c5
commit
f6110ce417
1 changed files with 1 additions and 1 deletions
|
@ -911,7 +911,7 @@ sub checkauth {
|
||||||
{
|
{
|
||||||
my $patron = Koha::Patrons->find( { userid => $userid } );
|
my $patron = Koha::Patrons->find( { userid => $userid } );
|
||||||
my $auth = Koha::Auth::TwoFactorAuth->new( { patron => $patron } );
|
my $auth = Koha::Auth::TwoFactorAuth->new( { patron => $patron } );
|
||||||
my $verified = $auth->verify($otp_token);
|
my $verified = $auth->verify($otp_token, 1);
|
||||||
$auth->clear;
|
$auth->clear;
|
||||||
if ( $verified ) {
|
if ( $verified ) {
|
||||||
# The token is correct, the user is fully logged in!
|
# The token is correct, the user is fully logged in!
|
||||||
|
|
Loading…
Reference in a new issue