Skip to content

Commit

Permalink
Bug 18118: Unexpected behaviour with 'GoogleOpenIDConnect' and 'OpacP…
Browse files Browse the repository at this point in the history
…ublic' syspref combination.

TEST PLAN
----------
1/ configure a working 'GoogleOpenIDConnect' account

See comment #5 which also links back to
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16892#c3

2/ set 'OpacPublic' (under OPAC) to 'Disabled' and
   'GoogleOpenIDConnect' (under Administration) to 'Yes'.

3/ log in user successfully via google-auth, observe redirect to
   opac-user.pl (bad)

4/ apply patch
   -- on kohadevbox remember to restart all! Plack is unforgiving. :)

5/ log in user successfully via google-auth, observe expected
   redirect to opac-main.pl (good)

While I would normally suggest running koha qa test tools, because
this file doesn't end in .pl, it doesn't get picked up by them.

6/ perlcritic -4 opac/svc/auth/googleopenidconnect
   -- notice this is a level better than required. :)

This also eyeballs easily well.

Signed-off-by: Mark Tompsett <[email protected]>

Signed-off-by: Kyle M Hall <[email protected]>

Signed-off-by: Jonathan Druart <[email protected]>
  • Loading branch information
KohaAloha authored and joubu committed Oct 27, 2017
1 parent bb1c184 commit 27b99bb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion opac/svc/auth/googleopenidconnect
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,16 @@ elsif ( defined $query->param('code') ) {
my ( $userid, $cookie, $session_id ) =
checkauth( $query, 1, {}, 'opac', $email );
if ($userid) { # A user with this email is registered in koha

#handle redirect to main.pl, for private opac
my $uri;
if (C4::Context->preference('OpacPublic') ) {
$uri = '/cgi-bin/koha/opac-user.pl';
} else {
$uri = '/cgi-bin/koha/opac-main.pl';
}
print $query->redirect(
-uri => '/cgi-bin/koha/opac-user.pl',
-uri => $uri,
-cookie => $cookie
);
}
Expand Down

0 comments on commit 27b99bb

Please sign in to comment.