View | Details | Raw Unified | Return to bug 28786
Collapse All | Expand All

(-)a/Koha/Auth/TwoFactorAuth.pm (-4 / +2 lines)
Lines 28-36 Koha::Auth::TwoFactorAuth- Koha class deal with Two factor authentication Link Here
28
28
29
use Koha::Auth::TwoFactorAuth;
29
use Koha::Auth::TwoFactorAuth;
30
30
31
my $secret = Koha::AuthUtils::generate_salt( 'weak', 16 );
31
my $auth = Koha::Auth::TwoFactorAuth->new({ patron => $patron });
32
my $auth = Koha::Auth::TwoFactorAuth->new(
33
    { patron => $patron, secret => $secret } );
34
my $secret32 = $auth->generate_secret32;
32
my $secret32 = $auth->generate_secret32;
35
my $ok = $auth->verify($pin_code, 1, $secret32);
33
my $ok = $auth->verify($pin_code, 1, $secret32);
36
34
Lines 40-46 It's based on Auth::GoogleAuth Link Here
40
38
41
=head3 new
39
=head3 new
42
40
43
    $obj = Koha::Auth::TwoFactorAuth->new({ patron => $p, secret => $s });
41
    $obj = Koha::Auth::TwoFactorAuth->new({ patron => $p, [secret => $secret], [secret32 => $secret32] });
44
42
45
=cut
43
=cut
46
44
(-)a/members/two_factor_auth.pl (-3 / +1 lines)
Lines 74-82 if ( $op eq 'register-2FA' ) { Link Here
74
74
75
if ( $op eq 'enable-2FA' ) {
75
if ( $op eq 'enable-2FA' ) {
76
76
77
    my $secret = Koha::AuthUtils::generate_salt( 'weak', 16 );
78
    my $auth = Koha::Auth::TwoFactorAuth->new(
77
    my $auth = Koha::Auth::TwoFactorAuth->new(
79
        { patron => $logged_in_user, secret => $secret } );
78
        { patron => $logged_in_user } );
80
79
81
    my $secret32 = $auth->generate_secret32;
80
    my $secret32 = $auth->generate_secret32;
82
    my $qr_code_url =
81
    my $qr_code_url =
83
- 

Return to bug 28786