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

(-)a/Koha/REST/V1/OAuth/Client.pm (-2 / +5 lines)
Lines 67-84 sub login { Link Here
67
    }
67
    }
68
68
69
    my $uri;
69
    my $uri;
70
    my $base_url;
70
71
71
    if ( $interface eq 'opac' ) {
72
    if ( $interface eq 'opac' ) {
73
        $base_url = C4::Context->preference('OPACBaseURL');
72
        if ( C4::Context->preference('OpacPublic') ) {
74
        if ( C4::Context->preference('OpacPublic') ) {
73
            $uri = '/cgi-bin/koha/opac-user.pl';
75
            $uri = '/cgi-bin/koha/opac-user.pl';
74
        } else {
76
        } else {
75
            $uri = '/cgi-bin/koha/opac-main.pl';
77
            $uri = '/cgi-bin/koha/opac-main.pl';
76
        }
78
        }
77
    } else {
79
    } else {
80
        $base_url = C4::Context->preference('staffClientBaseURL');
78
        $uri = '/cgi-bin/koha/mainpage.pl';
81
        $uri = '/cgi-bin/koha/mainpage.pl';
79
    }
82
    }
80
83
81
    return $c->oauth2->get_token_p($provider)->then(
84
85
    return $c->oauth2->get_token_p( $provider, { redirect_uri => $base_url . '/api/v1/public/oauth/login/' . $provider . "/" . $interface } )->then(
82
        sub {
86
        sub {
83
            return unless my $response = shift;
87
            return unless my $response = shift;
84
88
85
- 

Return to bug 31378