2023-10-17 19:18:19 +02:00
|
|
|
module.exports = {
|
|
|
|
fn() {
|
2023-10-19 16:05:34 +02:00
|
|
|
let oidc = null;
|
|
|
|
if (sails.hooks.oidc.isActive()) {
|
|
|
|
const oidcClient = sails.hooks.oidc.getClient();
|
|
|
|
|
|
|
|
oidc = {
|
|
|
|
authorizationUrl: oidcClient.authorizationUrl({
|
|
|
|
scope: sails.config.custom.oidcScopes,
|
|
|
|
response_mode: 'fragment',
|
|
|
|
}),
|
|
|
|
endSessionUrl: oidcClient.issuer.end_session_endpoint ? oidcClient.endSessionUrl({}) : null,
|
2024-02-01 00:31:15 +01:00
|
|
|
isEnforced: sails.config.custom.oidcEnforced,
|
2023-10-19 16:05:34 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2023-10-17 19:18:19 +02:00
|
|
|
return {
|
|
|
|
item: {
|
2023-10-19 16:05:34 +02:00
|
|
|
oidc,
|
2023-10-17 19:18:19 +02:00
|
|
|
},
|
|
|
|
};
|
|
|
|
},
|
|
|
|
};
|