|
Lines 90-96
subtest 'registration and verification' => sub {
Link Here
|
| 90 |
$tx = $t->ua->build_tx( POST => "/api/v1/auth/two-factor/registration" ); |
90 |
$tx = $t->ua->build_tx( POST => "/api/v1/auth/two-factor/registration" ); |
| 91 |
$tx->req->cookies( { name => 'CGISESSID', value => $session->id } ); |
91 |
$tx->req->cookies( { name => 'CGISESSID', value => $session->id } ); |
| 92 |
$tx->req->env( { REMOTE_ADDR => $remote_address } ); |
92 |
$tx->req->env( { REMOTE_ADDR => $remote_address } ); |
| 93 |
$t->request_ok($tx)->status_is(201); |
93 |
{ |
|
|
94 |
# Ignore the following warning |
| 95 |
# Use of uninitialized value $aMask[1383] in bitwise xor (^) at /usr/local/share/perl/5.36.0/GD/Barcode/QRcode.pm line 217. |
| 96 |
# We do not want to expect it (using Test::Warn): it is a bug from GD::Barcode |
| 97 |
local $SIG{__WARN__} = sub { }; |
| 98 |
my $dup_err; |
| 99 |
local *STDERR; |
| 100 |
open STDERR, ">>", \$dup_err; |
| 101 |
|
| 102 |
$t->request_ok($tx)->status_is(201); |
| 103 |
|
| 104 |
close STDERR; |
| 105 |
} |
| 94 |
my $secret32 = $t->tx->res->json->{secret32}; |
106 |
my $secret32 = $t->tx->res->json->{secret32}; |
| 95 |
|
107 |
|
| 96 |
$tx = $t->ua->build_tx( POST => "/api/v1/auth/two-factor/registration/verification" ); |
108 |
$tx = $t->ua->build_tx( POST => "/api/v1/auth/two-factor/registration/verification" ); |
|
Lines 120-126
subtest 'registration and verification' => sub {
Link Here
|
| 120 |
$tx = $t->ua->build_tx( POST => "/api/v1/auth/two-factor/registration" ); |
132 |
$tx = $t->ua->build_tx( POST => "/api/v1/auth/two-factor/registration" ); |
| 121 |
$tx->req->cookies( { name => 'CGISESSID', value => $session->id } ); |
133 |
$tx->req->cookies( { name => 'CGISESSID', value => $session->id } ); |
| 122 |
$tx->req->env( { REMOTE_ADDR => $remote_address } ); |
134 |
$tx->req->env( { REMOTE_ADDR => $remote_address } ); |
| 123 |
$t->request_ok($tx)->status_is(201); |
135 |
{ |
|
|
136 |
# Ignore the following warning |
| 137 |
# Use of uninitialized value $aMask[1383] in bitwise xor (^) at /usr/local/share/perl/5.36.0/GD/Barcode/QRcode.pm line 217. |
| 138 |
# We do not want to expect it (using Test::Warn): it is a bug from GD::Barcode |
| 139 |
local $SIG{__WARN__} = sub { }; |
| 140 |
my $dup_err; |
| 141 |
local *STDERR; |
| 142 |
open STDERR, ">>", \$dup_err; |
| 143 |
|
| 144 |
$t->request_ok($tx)->status_is(201); |
| 145 |
|
| 146 |
close STDERR; |
| 147 |
} |
| 124 |
$secret32 = $t->tx->res->json->{secret32}; |
148 |
$secret32 = $t->tx->res->json->{secret32}; |
| 125 |
|
149 |
|
| 126 |
$auth = Koha::Auth::TwoFactorAuth->new( { patron => $patron, secret32 => $secret32 } ); |
150 |
$auth = Koha::Auth::TwoFactorAuth->new( { patron => $patron, secret32 => $secret32 } ); |
| 127 |
- |
|
|