mirror of
https://github.com/plankanban/planka.git
synced 2025-07-23 15:19:44 +02:00
fix: Lazy initialize OIDC client (#947)
This commit is contained in:
parent
2109fea800
commit
480c280ab3
4 changed files with 58 additions and 23 deletions
|
@ -1,8 +1,26 @@
|
|||
const Errors = {
|
||||
INVALID_OIDC_CONFIGURATION: {
|
||||
invalidOidcConfiguration: 'Invalid OIDC configuration',
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
fn() {
|
||||
exits: {
|
||||
invalidOidcConfiguration: {
|
||||
responseType: 'serverError',
|
||||
},
|
||||
},
|
||||
|
||||
async fn() {
|
||||
let oidc = null;
|
||||
if (sails.hooks.oidc.isActive()) {
|
||||
const oidcClient = sails.hooks.oidc.getClient();
|
||||
let oidcClient;
|
||||
try {
|
||||
oidcClient = await sails.hooks.oidc.getClient();
|
||||
} catch (error) {
|
||||
sails.log.warn(`Error while initializing OIDC client: ${error}`);
|
||||
throw Errors.INVALID_OIDC_CONFIGURATION;
|
||||
}
|
||||
|
||||
const authorizationUrlParams = {
|
||||
scope: sails.config.custom.oidcScopes,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue