https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31042

Magnus Enger <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #11 from Magnus Enger <[email protected]> ---
Ran into this in the wild recently. I did a quick fix (for the OPAC) by
changing /usr/share/koha/lib/Koha/REST/V1/OAuth/Client.pm from this: 

 58     if ( $interface eq 'opac' ) {
 62         $redirect_url = C4::Context->preference('OPACBaseURL') .
'/api/v1/public/oauth/login/';
 64         if ( C4::Context->preference('OpacPublic') ) {
 65             $uri = '/cgi-bin/koha/opac-user.pl';
 66         } else {
 67             $uri = '/cgi-bin/koha/opac-main.pl';
 68         }
 69     } else {
 70         $redirect_url = C4::Context->preference('staffClientBaseURL') .
'/api/v1/oauth/login/';
 71         $uri = '/cgi-bin/koha/mainpage.pl';
 72     }

to this: 

 58     if ( $interface eq 'opac' ) {
 59         if ( defined $c->tx->req->env->{ 'OVERRIDE_SYSPREF_OPACBaseURL' }
&& $c->tx->req->env->{ 'OVERRIDE_SYSPREF_OPACBaseURL' } ne '' ) {
 60             $redirect_url = $c->tx->req->env->{
'OVERRIDE_SYSPREF_OPACBaseURL' } . '/api/v1/public/oauth/login/';
 61         } else {
 62             $redirect_url = C4::Context->preference('OPACBaseURL') .
'/api/v1/public/oauth/login/';
 63         }
 64         if ( C4::Context->preference('OpacPublic') ) {
 65             $uri = '/cgi-bin/koha/opac-user.pl';
 66         } else {
 67             $uri = '/cgi-bin/koha/opac-main.pl';
 68         }
 69     } else {
 70         $redirect_url = C4::Context->preference('staffClientBaseURL') .
'/api/v1/oauth/login/';
 71         $uri = '/cgi-bin/koha/mainpage.pl';
 72     }

It works, but a solution that goes more to the root of the problem would be
good.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to