@@ -, +, @@ --- Koha/Auth/TwoFactorAuth.pm | 6 ++---- members/two_factor_auth.pl | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) --- a/Koha/Auth/TwoFactorAuth.pm +++ a/Koha/Auth/TwoFactorAuth.pm @@ -28,9 +28,7 @@ Koha::Auth::TwoFactorAuth- Koha class deal with Two factor authentication use Koha::Auth::TwoFactorAuth; -my $secret = Koha::AuthUtils::generate_salt( 'weak', 16 ); -my $auth = Koha::Auth::TwoFactorAuth->new( - { patron => $patron, secret => $secret } ); +my $auth = Koha::Auth::TwoFactorAuth->new({ patron => $patron }); my $secret32 = $auth->generate_secret32; my $ok = $auth->verify($pin_code, 1, $secret32); @@ -40,7 +38,7 @@ It's based on Auth::GoogleAuth =head3 new - $obj = Koha::Auth::TwoFactorAuth->new({ patron => $p, secret => $s }); + $obj = Koha::Auth::TwoFactorAuth->new({ patron => $p, [secret => $secret], [secret32 => $secret32] }); =cut --- a/members/two_factor_auth.pl +++ a/members/two_factor_auth.pl @@ -74,9 +74,8 @@ if ( $op eq 'register-2FA' ) { if ( $op eq 'enable-2FA' ) { - my $secret = Koha::AuthUtils::generate_salt( 'weak', 16 ); my $auth = Koha::Auth::TwoFactorAuth->new( - { patron => $logged_in_user, secret => $secret } ); + { patron => $logged_in_user } ); my $secret32 = $auth->generate_secret32; my $qr_code_url = --