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 350-355
sub _basic_auth {
Link Here
|
350 |
Koha::Exceptions::Authorization::Unauthorized->throw( error => 'Password has expired' ); |
353 |
Koha::Exceptions::Authorization::Unauthorized->throw( error => 'Password has expired' ); |
351 |
} |
354 |
} |
352 |
|
355 |
|
|
|
356 |
#update lastseen for API user |
357 |
$patron->update_lastseen('api_basic_auth'); |
358 |
|
353 |
return $patron; |
359 |
return $patron; |
354 |
} |
360 |
} |
355 |
|
361 |
|