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

(-)a/Koha/REST/V1/Auth.pm (+3 lines)
Lines 149-154 sub authenticate_api_request { Link Here
149
149
150
    my $user;
150
    my $user;
151
151
152
    $c->stash( 'is_public' => 1 )
153
        if $params->{is_public};
154
152
    # The following supports retrieval of spec with Mojolicious::Plugin::OpenAPI@1.17 and later (first one)
155
    # The following supports retrieval of spec with Mojolicious::Plugin::OpenAPI@1.17 and later (first one)
153
    # and older versions (second one).
156
    # and older versions (second one).
154
    # TODO: remove the latter 'openapi.op_spec' if minimum version is bumped to at least 1.17.
157
    # TODO: remove the latter 'openapi.op_spec' if minimum version is bumped to at least 1.17.
(-)a/t/db_dependent/api/v1/auth_authenticate_api_request.t (-2 / +23 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 5;
20
use Test::More tests => 6;
21
use Test::Mojo;
21
use Test::Mojo;
22
22
23
use Module::Load::Conditional qw(can_load);
23
use Module::Load::Conditional qw(can_load);
Lines 296-301 subtest 'x-koha-override stash tests' => sub { Link Here
296
    $schema->storage->txn_rollback;
296
    $schema->storage->txn_rollback;
297
};
297
};
298
298
299
subtest 'public routes have "is_public" info stashed' => sub {
300
301
    plan tests => 2;
302
303
    $schema->storage->txn_begin;
304
305
    my $stash;
306
    $t->app->hook(
307
        after_dispatch => sub {
308
            $stash = shift->stash;
309
        }
310
    );
311
312
    $t->get_ok('/api/v1/public/biblios/1');
313
314
    my $is_public = $stash->{is_public};
315
316
    ok( $is_public, 'Correctly stashed the fact it is a public route' );
317
318
    $schema->storage->txn_rollback;
319
};
320
299
sub create_user_and_session {
321
sub create_user_and_session {
300
322
301
    my $args  = shift;
323
    my $args  = shift;
302
- 

Return to bug 28948