@@ -, +, @@ /auth/otp/token_delivery --- Koha/REST/V1/Auth.pm | 2 +- api/v1/swagger/paths/auth.yaml | 2 +- api/v1/swagger/swagger.yaml | 4 ++-- koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt | 2 +- t/db_dependent/api/v1/two_factor_auth.t | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) --- a/Koha/REST/V1/Auth.pm +++ a/Koha/REST/V1/Auth.pm @@ -231,7 +231,7 @@ sub authenticate_api_request { $cookie_auth = 1; } elsif ($status eq "additional-auth-needed") { - if ( $c->req->url->to_abs->path eq '/api/v1/auth/send_otp_token' ) { + if ( $c->req->url->to_abs->path eq '/api/v1/auth/otp/token_delivery' ) { $user = Koha::Patrons->find( $session->param('number') ); $cookie_auth = 1; } else { --- a/api/v1/swagger/paths/auth.yaml +++ a/api/v1/swagger/paths/auth.yaml @@ -1,5 +1,5 @@ --- -/auth/send_otp_token: +/auth/otp/token_delivery: post: x-mojo-to: TwoFactorAuth#send_otp_token operationId: send_otp_token --- a/api/v1/swagger/swagger.yaml +++ a/api/v1/swagger/swagger.yaml @@ -101,8 +101,8 @@ paths: $ref: "./paths/advancededitormacros.yaml#/~1advanced_editor~1macros~1{advancededitormacro_id}" "/article_requests/{article_request_id}": $ref: "./paths/article_requests.yaml#/~1article_requests~1{article_request_id}" - /auth/send_otp_token: - $ref: paths/auth.yaml#/~1auth~1send_otp_token + /auth/otp/token_delivery: + $ref: paths/auth.yaml#/~1auth~1otp~1token_delivery "/biblios/{biblio_id}": $ref: "./paths/biblios.yaml#/~1biblios~1{biblio_id}" "/biblios/{biblio_id}/checkouts": --- a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt @@ -198,7 +198,7 @@ $("#email_success").hide(); $("#email_error").hide(); $.ajax({ - url: '/api/v1/auth/send_otp_token', + url: '/api/v1/auth/otp/token_delivery', type: 'POST', success: function(data){ let message = _("The code has been sent by email, please check your inbox.") --- a/t/db_dependent/api/v1/two_factor_auth.t +++ a/t/db_dependent/api/v1/two_factor_auth.t @@ -58,7 +58,7 @@ subtest 'send_otp_token' => sub { $session->param( 'lasttime', time() ); $session->flush; - my $tx = $t->ua->build_tx( POST => "/api/v1/auth/send_otp_token" ); + my $tx = $t->ua->build_tx( POST => "/api/v1/auth/otp/token_delivery" ); $tx->req->cookies( { name => 'CGISESSID', value => $session->id } ); $tx->req->env( { REMOTE_ADDR => $remote_address } ); @@ -85,7 +85,7 @@ subtest 'send_otp_token' => sub { $patron->email(undef); $patron->store; - $tx = $t->ua->build_tx( POST => "/api/v1/auth/send_otp_token" ); + $tx = $t->ua->build_tx( POST => "/api/v1/auth/otp/token_delivery" ); $tx->req->cookies( { name => 'CGISESSID', value => $session->id } ); $tx->req->env( { REMOTE_ADDR => $remote_address } ); @@ -93,7 +93,7 @@ subtest 'send_otp_token' => sub { $t->request_ok($tx)->status_is(400)->json_is({ error => 'email_not_sent' }); $patron->email('to@example.org')->store; - $tx = $t->ua->build_tx( POST => "/api/v1/auth/send_otp_token" ); + $tx = $t->ua->build_tx( POST => "/api/v1/auth/otp/token_delivery" ); $tx->req->cookies( { name => 'CGISESSID', value => $session->id } ); $tx->req->env( { REMOTE_ADDR => $remote_address } ); --