diff --git a/C4/Auth.pm b/C4/Auth.pm index e8e75b84ce..bb00ded4a9 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -912,7 +912,7 @@ sub checkauth { # voluntary logout the user # check wether the user was using their shibboleth session or a local one - my $shibSuccess = C4::Context->userenv->{'shibboleth'}; + my $shibSuccess = C4::Context->userenv ? C4::Context->userenv->{'shibboleth'} : undef; $session->delete(); $session->flush; $cookie = $cookie_mgr->clear_unless( $query->cookie, @$cookie ); diff --git a/C4/Auth_with_shibboleth.pm b/C4/Auth_with_shibboleth.pm index e214a5307c..10296c4323 100644 --- a/C4/Auth_with_shibboleth.pm +++ b/C4/Auth_with_shibboleth.pm @@ -54,6 +54,7 @@ sub logout_shib { my $uri = _get_uri(); my $return = _get_return($query); print $query->redirect( $uri . "/Shibboleth.sso/Logout?return=$return" ); + exit; } # Returns Shibboleth login URL with callback to the requesting URL