Lines 48-54
my $op = $cgi->param('op') // '';
Link Here
|
48 |
if ( $op eq 'register-2FA' ) { |
48 |
if ( $op eq 'register-2FA' ) { |
49 |
my $pin_code = $cgi->param('pin_code'); |
49 |
my $pin_code = $cgi->param('pin_code'); |
50 |
my $secret32 = $cgi->param('secret32'); |
50 |
my $secret32 = $cgi->param('secret32'); |
51 |
my $auth = Koha::Auth::TwoFactorAuth::get_auth( |
51 |
my $auth = Koha::Auth::TwoFactorAuth->new( |
52 |
{ patron => $logged_in_user, secret32 => $secret32 } ); |
52 |
{ patron => $logged_in_user, secret32 => $secret32 } ); |
53 |
|
53 |
|
54 |
my $verified = $auth->verify( |
54 |
my $verified = $auth->verify( |
Lines 75-81
if ( $op eq 'register-2FA' ) {
Link Here
|
75 |
if ( $op eq 'enable-2FA' ) { |
75 |
if ( $op eq 'enable-2FA' ) { |
76 |
|
76 |
|
77 |
my $secret = Koha::AuthUtils::generate_salt( 'weak', 16 ); |
77 |
my $secret = Koha::AuthUtils::generate_salt( 'weak', 16 ); |
78 |
my $auth = Koha::Auth::TwoFactorAuth::get_auth( |
78 |
my $auth = Koha::Auth::TwoFactorAuth->new( |
79 |
{ patron => $logged_in_user, secret => $secret } ); |
79 |
{ patron => $logged_in_user, secret => $secret } ); |
80 |
|
80 |
|
81 |
my $secret32 = $auth->generate_secret32; |
81 |
my $secret32 = $auth->generate_secret32; |
82 |
- |
|
|