Bug 24003: (follow-up) Move interface setting to a more readable place
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6b2d8b6779)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
3d9d07d03b
commit
06c246a067
|
|
@ -182,7 +182,6 @@ sub authenticate_api_request {
|
|||
if ($valid_token) {
|
||||
my $patron_id = Koha::ApiKeys->find( $valid_token->{client_id} )->patron_id;
|
||||
$user = Koha::Patrons->find($patron_id);
|
||||
C4::Context->interface('api');
|
||||
}
|
||||
else {
|
||||
# If we have "Authorization: Bearer" header and oauth authentication
|
||||
|
|
@ -199,7 +198,6 @@ sub authenticate_api_request {
|
|||
);
|
||||
}
|
||||
$user = $c->_basic_auth( $authorization_header );
|
||||
C4::Context->interface('api');
|
||||
unless ( $user ) {
|
||||
# If we have "Authorization: Basic" header and authentication
|
||||
# failed, do not try other authentication means
|
||||
|
|
@ -248,6 +246,7 @@ sub authenticate_api_request {
|
|||
}
|
||||
|
||||
$c->stash('koha.user' => $user);
|
||||
C4::Context->interface('api');
|
||||
|
||||
if ( $user and !$cookie_auth ) { # cookie-auth sets this and more, don't mess with that
|
||||
C4::Context->_new_userenv( $user->borrowernumber );
|
||||
|
|
|
|||
Loading…
Reference in New Issue