From 292d4c4b5e38c4a5a213c3801cd2d02350c7eca5 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 26 Jan 2022 12:34:02 +0000 Subject: [PATCH] Bug 29915: (experimental) Add skip_auth_template param in checkauth Content-Type: text/plain; charset=utf-8 The skip_auth_template param allows you to skip printing the http cruft when running tests for C4::Auth::checkauth. It will not be used in regular calls. And does not affect them. Test plan: See next patch. Signed-off-by: Marcel de Rooy --- C4/Auth.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 5b8813ad9b..dfa43ca97d 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -807,6 +807,7 @@ sub checkauth { my $type = shift; my $emailaddress = shift; my $template_name = shift; + my $params = shift; # 29915 $type = 'opac' unless $type; unless ( C4::Context->preference("OpacPublic") ) { @@ -1394,7 +1395,7 @@ sub checkauth { 'X-Frame-Options' => 'SAMEORIGIN' } ), - $template->output; + $template->output unless $params->{skip_auth_template}; safe_exit; } -- 2.20.1