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

(-)a/Koha/REST/V1.pm (-4 / +6 lines)
Lines 28-37 sub startup { Link Here
28
    my $route = $self->routes->under->to(
28
    my $route = $self->routes->under->to(
29
        cb => sub {
29
        cb => sub {
30
            my $c = shift;
30
            my $c = shift;
31
            # Mojo doesn't use %ENV the way CGI apps do
32
            # Manually pass the remote_address to check_auth_cookie
33
            my $remote_addr = $c->tx->remote_address;
34
            my ($status, $sessionID) = check_cookie_auth(
35
                                            $c->cookie('CGISESSID'), undef,
36
                                            { remote_addr => $remote_addr });
31
37
32
            # ENV{REMOTE_ADDR} is not set here, we need to read the headers
33
            my $remote_addr = $c->req->headers->header('x-forwarded-for');
34
            my ($status, $sessionID) = check_cookie_auth($c->cookie('CGISESSID'), undef, { remote_addr => $remote_addr });
35
            if ($status eq "ok") {
38
            if ($status eq "ok") {
36
                my $session = get_session($sessionID);
39
                my $session = get_session($sessionID);
37
                my $user = Koha::Patrons->find($session->param('number'));
40
                my $user = Koha::Patrons->find($session->param('number'));
38
- 

Return to bug 17050