View | Details | Raw Unified | Return to bug 34164
Collapse All | Expand All

(-)a/opac/svc/auth/googleopenidconnect (-5 / +11 lines)
Lines 214-223 elsif ( defined $query->param('code') ) { Link Here
214
214
215
                    #handle redirect to main.pl, for private opac
215
                    #handle redirect to main.pl, for private opac
216
                    my $uri;
216
                    my $uri;
217
                    if (C4::Context->preference('OpacPublic') ) {
217
                    my $referer = $session->param( 'auth-refer-uri' );
218
                        $uri    =  '/cgi-bin/koha/opac-user.pl';
218
        		    if ( $referer =~ /^$host/ ) {
219
                    } else {
219
		                my $regex = qr/logout\.x=1/mp;
220
                        $uri    =  '/cgi-bin/koha/opac-main.pl';
220
		                $uri = $referer =~ s/$regex//rg;
221
		            } else {
222
                        if (C4::Context->preference('OpacPublic') ) {
223
                            $uri    =  '/cgi-bin/koha/opac-user.pl';
224
                        } else {
225
                            $uri    =  '/cgi-bin/koha/opac-main.pl';
226
                        }
221
                    }
227
                    }
222
                    print $query->redirect(
228
                    print $query->redirect(
223
                        -uri    => $uri,
229
                        -uri    => $uri,
Lines 244-249 else { Link Here
244
    my $openidstate = 'auth_';
250
    my $openidstate = 'auth_';
245
    $openidstate .= sprintf( "%x", rand 16 ) for 1 .. 32;
251
    $openidstate .= sprintf( "%x", rand 16 ) for 1 .. 32;
246
    $session->param( 'google-openid-state', $openidstate );
252
    $session->param( 'google-openid-state', $openidstate );
253
    $session->param( 'auth-refer-uri', $ENV{HTTP_REFERER} );
247
    $session->flush();
254
    $session->flush();
248
255
249
    my $prompt = $query->param('reauthenticate') // q{};
256
    my $prompt = $query->param('reauthenticate') // q{};
250
- 

Return to bug 34164