Bug 31378: (follow-up) catch startup error when missing Oauth provider table
In theory, this shouldn't come up with a package install, but it could happen with other installations, so best to let it get to the web installer. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
9e2cf4d358
commit
2cf2fba315
|
|
@ -140,12 +140,17 @@ sub startup {
|
|||
};
|
||||
|
||||
my $oauth_configuration = {};
|
||||
my $search_options = { protocol => [ "OIDC", "OAuth" ] };
|
||||
my $providers = Koha::Auth::Identity::Providers->search( $search_options );
|
||||
try {
|
||||
my $search_options = { protocol => [ "OIDC", "OAuth" ] };
|
||||
|
||||
while(my $provider = $providers->next) {
|
||||
$oauth_configuration->{$provider->code} = decode_json($provider->config);
|
||||
}
|
||||
my $providers = Koha::Auth::Identity::Providers->search($search_options);
|
||||
while ( my $provider = $providers->next ) {
|
||||
$oauth_configuration->{ $provider->code } = decode_json( $provider->config );
|
||||
}
|
||||
} catch {
|
||||
my $logger = Koha::Logger->get( { interface => 'api' } );
|
||||
$logger->warn( "Warning: Failed to fetch oauth configuration: " . $_ );
|
||||
};
|
||||
|
||||
$self->plugin( 'Koha::REST::Plugin::Pagination' );
|
||||
$self->plugin( 'Koha::REST::Plugin::Query' );
|
||||
|
|
|
|||
Loading…
Reference in New Issue