From 66f9d71e7b102c36c201ea11e82e9865018a4dca 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 Adding the same auth_status check here too. Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart --- svc/checkouts | 7 +++++-- svc/return_claims | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/svc/checkouts b/svc/checkouts index 30bbee53b1a..096d953d1fa 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 5ac7d49e79a..726b756f838 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.25.1