Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
use Mojo::Base 'Mojolicious';
use C4::Auth qw( check_cookie_auth get_session );
+use C4::Context;
use Koha::Borrowers;
sub startup {
# Force charset=utf8 in Content-Type header for JSON responses
$self->types->type(json => 'application/json; charset=utf8');
+ my $secret_passphrase = C4::Context->config('api_secret_passphrase');
+ if ($secret_passphrase) {
+ $self->secrets([$secret_passphrase]);
+ }
+
$self->plugin(Swagger2 => {
route => $route,
url => $self->home->rel_file("api/v1/swagger.json"),
<queryparser_config>__KOHA_CONF_DIR__/searchengine/queryparser.yaml</queryparser_config>
<log4perl_conf>__KOHA_CONF_DIR__/log4perl.conf</log4perl_conf>
+ <!-- Secret passphrase used by Mojolicious for signed cookies -->
+ <api_secret_passphrase>CHANGEME</api_secret_passphrase>
+
<!-- true type font mapping accoding to type from $font_types in C4/Creators/Lib.pm -->
<ttf>
<font type="TR" >/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf</font>