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

(-)a/Koha/REST/V1/Auth.pm (-5 / +5 lines)
Lines 74-84 sub under { Link Here
74
            $is_plugin = 1;
74
            $is_plugin = 1;
75
        }
75
        }
76
76
77
        if ( $is_public
77
        if ( $is_public ) {
78
            and !C4::Context->preference('RESTPublicAPI') )
78
            Koha::Exceptions::UnderMaintenance->throw('Under maintenance')
79
        {
79
                if C4::Context->preference('OPACMaintenance');
80
            Koha::Exceptions::Authorization->throw(
80
            Koha::Exceptions::Authorization->throw(
81
                "Configuration prevents the usage of this endpoint by unprivileged users");
81
                "Configuration prevents the usage of this endpoint by unprivileged users")
82
                if !C4::Context->preference('RESTPublicAPI');
82
        }
83
        }
83
84
84
        if ( $c->req->url->to_abs->path =~ m#^/api/v1/oauth/# || $c->req->url->to_abs->path =~ m#^/api/v1/public/oauth/#) {
85
        if ( $c->req->url->to_abs->path =~ m#^/api/v1/oauth/# || $c->req->url->to_abs->path =~ m#^/api/v1/public/oauth/#) {
85
- 

Return to bug 34999