]> git.koha-community.org Git - koha.git/commit
Bug 37056: Mount a new intranet_svc api to avoid redirects
authorNick Clemens <nick@bywatersolutions.com>
Fri, 7 Jun 2024 16:59:58 +0000 (16:59 +0000)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Tue, 2 Jul 2024 15:20:37 +0000 (17:20 +0200)
commitedc5caf976d2fe3348c890c90e980e296f6ac92c
tree17a68ad32d8e91b983f05fdfea6779dbdcb1d142
parentaeb2a50a0bf41f5d91bf614ab0fc976e2ac13862
Bug 37056: Mount a new intranet_svc api to avoid redirects

When an unauthorized call to svc is made, we use the ErrorDocument middleware to respond with an HTML
page. The API doens't do this, it simply returns its status. We should mount the svc as its own app to avoid
the redirect to HTML for unauthorized responses

To test:
1 - Create a report
2 - Add to IntranetUserJs:
    $(document).ready(function() {
      // Your report ID
      var reportId = '492';

      // Fetch the report
      $.get('/cgi-bin/koha/svc/report?id=' + reportId, function(data) {
        console.log('Kaboom');
      });
    });
3 - Log out
4 - Attempt to login
5 - KO
6 - Apply patch
7 - Reset all (or copy the necessary changes to your plack/apache files)
8 - Generate report and update user js again
8 - Logout, login
9 - Success!

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
debian/templates/apache-shared-intranet-plack.conf
debian/templates/plack.psgi
svc/report