Bug 18046: CAS logout infinite redirect
authorChris Cormack <chrisc@catalyst.net.nz>
Tue, 1 Aug 2017 22:15:10 +0000 (10:15 +1200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 25 Aug 2017 13:20:06 +0000 (10:20 -0300)
To test (You need a CAS server and CAS configured in Koha)

1/ Login using CAS in Koha
2/ Logout in Koha
3/ Notice you get redirected again and again
4/ Apply patch
5/ Login with CAS, then logout
6/ Notice logout works, but no longer infinitely redirected

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Patch has been in production use for several months
on several instances. Fixes a critical bug.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Looks like a typical workaround, but evidently works.
Not tested with CAS.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

C4/Auth_with_cas.pm

index b69124b..e14c6e6 100644 (file)
@@ -66,6 +66,7 @@ sub getMultipleAuth {
 sub logout_cas {
     my ($query, $type) = @_;
     my ( $cas, $uri ) = _get_cas_and_service($query, undef, $type);
+    $uri =~ s/\?logout\.x=1//; # We don't want to keep triggering a logout, if we got here, the borrower is already logged out of Koha
     print $query->redirect( $cas->logout_url(url => $uri));
 }