From 9d0a3a27fc156c4ea2997372749f727c8002c79c Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Tue, 25 Jan 2022 12:21:42 +0000 Subject: [PATCH] Bug 29931: (follow-up) Fix svc/checkouts and return_claims too Content-Type: text/plain; charset=utf-8 Adding the same auth_status check here too. Signed-off-by: Marcel de Rooy --- svc/checkouts | 7 +++++-- svc/return_claims | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/svc/checkouts b/svc/checkouts index 30bbee53b1..096d953d1f 100755 --- a/svc/checkouts +++ b/svc/checkouts @@ -33,8 +33,11 @@ use Koha::ItemTypes; my $input = CGI->new; -my ( $auth_status, $session ) = - check_cookie_auth( $input->cookie('CGISESSID')); +my ( $auth_status, $session ) = check_cookie_auth( $input->cookie('CGISESSID')); +if( $auth_status ne 'ok' ) { + print CGI::header( '-status' => '401' ); + exit 0; +} my $userid = $session->param('id'); diff --git a/svc/return_claims b/svc/return_claims index 5ac7d49e79..726b756f83 100755 --- a/svc/return_claims +++ b/svc/return_claims @@ -31,8 +31,11 @@ use Koha::Patrons; my $input = CGI->new; -my ( $auth_status, $session ) = - check_cookie_auth( $input->cookie('CGISESSID') ); +my ( $auth_status, $session ) = check_cookie_auth( $input->cookie('CGISESSID') ); +if( $auth_status ne 'ok' ) { + print CGI::header( '-status' => '401' ); + exit 0; +} my $userid = $session->param('id'); -- 2.20.1