Lines 19-24
use Modern::Perl;
Link Here
|
19 |
use GD::Barcode; |
19 |
use GD::Barcode; |
20 |
use MIME::Base64 qw( encode_base64 ); |
20 |
use MIME::Base64 qw( encode_base64 ); |
21 |
|
21 |
|
|
|
22 |
use C4::Context; |
22 |
use C4::Letters; |
23 |
use C4::Letters; |
23 |
use Koha::Exceptions; |
24 |
use Koha::Exceptions; |
24 |
use Koha::Exceptions::Patron; |
25 |
use Koha::Exceptions::Patron; |
Lines 106-109
sub qr_code {
Link Here
|
106 |
return "data:image/png;base64,". encode_base64( $data, q{} ); # does not contain newlines |
107 |
return "data:image/png;base64,". encode_base64( $data, q{} ); # does not contain newlines |
107 |
} |
108 |
} |
108 |
|
109 |
|
|
|
110 |
=head3 verify |
111 |
|
112 |
my $verified = $auth->verify($otp_token); |
113 |
|
114 |
Replacement for Auth::GoogleAuth::verify. |
115 |
This uses a system wide default for range. |
116 |
|
117 |
=cut |
118 |
|
119 |
sub verify { |
120 |
my ( $self, $code, $range, $secret32, $timestamp, $interval ) = @_; |
121 |
if ( !defined $range ) { |
122 |
my $mfa_range = C4::Context->config('mfa_range') ? int( C4::Context->config('mfa_range') ) : 1; |
123 |
if ($mfa_range) { |
124 |
$range = $mfa_range; |
125 |
} |
126 |
} |
127 |
return $self->SUPER::verify( $code, $range, $secret32, $timestamp, $interval ); |
128 |
} |
129 |
|
109 |
1; |
130 |
1; |