Bugzilla – Attachment 163128 Details for
Bug 34164
OAuth2/OIDC should redirect to page that initiated login
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Redirect to referring URL, excluding logout parameters
0001-Return-to-the-page-you-were-on-when-authenticating-s.patch (text/plain), 1.62 KB, created by
Nicholas van Oudtshoorn
on 2024-03-14 04:32:07 UTC
(
hide
)
Description:
Redirect to referring URL, excluding logout parameters
Filename:
MIME Type:
Creator:
Nicholas van Oudtshoorn
Created:
2024-03-14 04:32:07 UTC
Size:
1.62 KB
patch
obsolete
>From 8b700d6e9bc129b2736c5ef439d7bdd0ca4ed1d2 Mon Sep 17 00:00:00 2001 >From: Nicholas van Oudtshoorn <vanoudt@gmail.com> >Date: Thu, 14 Mar 2024 11:47:06 +0800 >Subject: [PATCH] Return to the page you were on when authenticating, stripping > the logout instruction from the referer uri. If the referer uri doesn't match > the base url, redirect to either the main page or the user page. > >--- > opac/cgi-bin/opac/svc/auth/googleopenidconnect | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > >diff --git a/opac/cgi-bin/opac/svc/auth/googleopenidconnect b/opac/cgi-bin/opac/svc/auth/googleopenidconnect >index cde334f..ad43f0b 100755 >--- a/opac/cgi-bin/opac/svc/auth/googleopenidconnect >+++ b/opac/cgi-bin/opac/svc/auth/googleopenidconnect >@@ -214,12 +214,16 @@ elsif ( defined $query->param('code') ) { > #handle redirect to main.pl, for private opac > my $uri; > my $referer = $session->param( 'auth-refer-uri' ); >- if (C4::Context->preference('OpacPublic') ) { >+ if ( $referer =~ /^$host/ ) { >+ my $regex = qr/logout\.x=1/mp; >+ $uri = $referer =~ s/$regex//rg; >+ } else { >+ if (C4::Context->preference('OpacPublic') ) { > $uri = '/cgi-bin/koha/opac-user.pl'; >- } else { >+ } else { > $uri = '/cgi-bin/koha/opac-main.pl'; >- } >- $uri = $referer; >+ } >+ } > print $query->redirect( > -uri => $uri, > -cookie => $cookie >-- >2.34.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34164
:
163127
|
163128
|
163129
|
163493
|
163494
|
163495
|
163496
|
164979
|
164980