Lines 58-64
subtest 'send_otp_token' => sub {
Link Here
|
58 |
$session->param( 'lasttime', time() ); |
58 |
$session->param( 'lasttime', time() ); |
59 |
$session->flush; |
59 |
$session->flush; |
60 |
|
60 |
|
61 |
my $tx = $t->ua->build_tx( POST => "/api/v1/auth/send_otp_token" ); |
61 |
my $tx = $t->ua->build_tx( POST => "/api/v1/auth/otp/token_delivery" ); |
62 |
$tx->req->cookies( { name => 'CGISESSID', value => $session->id } ); |
62 |
$tx->req->cookies( { name => 'CGISESSID', value => $session->id } ); |
63 |
$tx->req->env( { REMOTE_ADDR => $remote_address } ); |
63 |
$tx->req->env( { REMOTE_ADDR => $remote_address } ); |
64 |
|
64 |
|
Lines 85-91
subtest 'send_otp_token' => sub {
Link Here
|
85 |
$patron->email(undef); |
85 |
$patron->email(undef); |
86 |
$patron->store; |
86 |
$patron->store; |
87 |
|
87 |
|
88 |
$tx = $t->ua->build_tx( POST => "/api/v1/auth/send_otp_token" ); |
88 |
$tx = $t->ua->build_tx( POST => "/api/v1/auth/otp/token_delivery" ); |
89 |
$tx->req->cookies( { name => 'CGISESSID', value => $session->id } ); |
89 |
$tx->req->cookies( { name => 'CGISESSID', value => $session->id } ); |
90 |
$tx->req->env( { REMOTE_ADDR => $remote_address } ); |
90 |
$tx->req->env( { REMOTE_ADDR => $remote_address } ); |
91 |
|
91 |
|
Lines 93-99
subtest 'send_otp_token' => sub {
Link Here
|
93 |
$t->request_ok($tx)->status_is(400)->json_is({ error => 'email_not_sent' }); |
93 |
$t->request_ok($tx)->status_is(400)->json_is({ error => 'email_not_sent' }); |
94 |
|
94 |
|
95 |
$patron->email('to@example.org')->store; |
95 |
$patron->email('to@example.org')->store; |
96 |
$tx = $t->ua->build_tx( POST => "/api/v1/auth/send_otp_token" ); |
96 |
$tx = $t->ua->build_tx( POST => "/api/v1/auth/otp/token_delivery" ); |
97 |
$tx->req->cookies( { name => 'CGISESSID', value => $session->id } ); |
97 |
$tx->req->cookies( { name => 'CGISESSID', value => $session->id } ); |
98 |
$tx->req->env( { REMOTE_ADDR => $remote_address } ); |
98 |
$tx->req->env( { REMOTE_ADDR => $remote_address } ); |
99 |
|
99 |
|
100 |
- |
|
|