|
Lines 82-88
sub under {
Link Here
|
| 82 |
} |
82 |
} |
| 83 |
|
83 |
|
| 84 |
if ( $c->req->url->to_abs->path eq '/api/v1/oauth/token' ) { |
84 |
if ( $c->req->url->to_abs->path eq '/api/v1/oauth/token' ) { |
| 85 |
#|| $c->req->url->to_abs->path eq '/api/v1/auth/send_otp_token' ) { |
|
|
| 86 |
# Requesting a token shouldn't go through the API authenticaction chain |
85 |
# Requesting a token shouldn't go through the API authenticaction chain |
| 87 |
$status = 1; |
86 |
$status = 1; |
| 88 |
} |
87 |
} |
|
Lines 235-241
sub authenticate_api_request {
Link Here
|
| 235 |
if ( $c->req->url->to_abs->path eq '/api/v1/auth/send_otp_token' ) { |
234 |
if ( $c->req->url->to_abs->path eq '/api/v1/auth/send_otp_token' ) { |
| 236 |
$user = Koha::Patrons->find( $session->param('number') ); |
235 |
$user = Koha::Patrons->find( $session->param('number') ); |
| 237 |
$cookie_auth = 1; |
236 |
$cookie_auth = 1; |
| 238 |
$pending_auth = 1; |
237 |
} else { |
|
|
238 |
Koha::Exceptions::Authentication::Required->throw( |
| 239 |
error => 'Authentication failure.' |
| 240 |
); |
| 239 |
} |
241 |
} |
| 240 |
} |
242 |
} |
| 241 |
elsif ($status eq "maintenance") { |
243 |
elsif ($status eq "maintenance") { |
|
Lines 271-277
sub authenticate_api_request {
Link Here
|
| 271 |
( $params->{is_public} and |
273 |
( $params->{is_public} and |
| 272 |
( C4::Context->preference('RESTPublicAnonymousRequests') or |
274 |
( C4::Context->preference('RESTPublicAnonymousRequests') or |
| 273 |
$user) or $params->{is_plugin} ) |
275 |
$user) or $params->{is_plugin} ) |
| 274 |
or $pending_auth |
|
|
| 275 |
) { |
276 |
) { |
| 276 |
# We do not need any authorization |
277 |
# We do not need any authorization |
| 277 |
# Check the parameters |
278 |
# Check the parameters |