You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
805 B
JavaScript
30 lines
805 B
JavaScript
module.exports = {
|
|
fn() {
|
|
let oidc = null;
|
|
if (sails.hooks.oidc.isActive()) {
|
|
const oidcClient = sails.hooks.oidc.getClient();
|
|
|
|
const authorizationUrlParams = {
|
|
scope: sails.config.custom.oidcScopes,
|
|
};
|
|
|
|
if (!sails.config.custom.oidcUseDefaultResponseMode) {
|
|
authorizationUrlParams.response_mode = sails.config.custom.oidcResponseMode;
|
|
}
|
|
|
|
oidc = {
|
|
authorizationUrl: oidcClient.authorizationUrl(authorizationUrlParams),
|
|
endSessionUrl: oidcClient.issuer.end_session_endpoint ? oidcClient.endSessionUrl({}) : null,
|
|
isEnforced: sails.config.custom.oidcEnforced,
|
|
};
|
|
}
|
|
|
|
return {
|
|
item: {
|
|
oidc,
|
|
allowAllToCreateProjects: sails.config.custom.allowAllToCreateProjects,
|
|
},
|
|
};
|
|
},
|
|
};
|