|
Lines 176-181
sub authenticate_api_request {
Link Here
|
| 176 |
if ($valid_token) { |
176 |
if ($valid_token) { |
| 177 |
my $patron_id = Koha::ApiKeys->find( $valid_token->{client_id} )->patron_id; |
177 |
my $patron_id = Koha::ApiKeys->find( $valid_token->{client_id} )->patron_id; |
| 178 |
$user = Koha::Patrons->find($patron_id); |
178 |
$user = Koha::Patrons->find($patron_id); |
|
|
179 |
|
| 180 |
#record lastseen for API user using OAuth2 |
| 181 |
$user->update_lastseen('api_oauth2'); |
| 179 |
} else { |
182 |
} else { |
| 180 |
|
183 |
|
| 181 |
# If we have "Authorization: Bearer" header and oauth authentication |
184 |
# If we have "Authorization: Bearer" header and oauth authentication |
|
Lines 349-354
sub _basic_auth {
Link Here
|
| 349 |
Koha::Exceptions::Authorization::Unauthorized->throw( error => 'Password has expired' ); |
352 |
Koha::Exceptions::Authorization::Unauthorized->throw( error => 'Password has expired' ); |
| 350 |
} |
353 |
} |
| 351 |
|
354 |
|
|
|
355 |
#update lastseen for API user |
| 356 |
$patron->update_lastseen('api_basic_auth'); |
| 357 |
|
| 352 |
return $patron; |
358 |
return $patron; |
| 353 |
} |
359 |
} |
| 354 |
|
360 |
|