diff --git a/src/infrastructure/oidc/index.js b/src/infrastructure/oidc/index.js index 818b94e1..2e066df5 100644 --- a/src/infrastructure/oidc/index.js +++ b/src/infrastructure/oidc/index.js @@ -115,7 +115,7 @@ const init = async (app) => { } if(allUserServices && allUserServices.roles){ - const { roles } = allUserServices; + const roles = allUserServices.roles.sort((a, b) => a.name.localeCompare(b.name, 'es', {sensitivity: 'base'})); const supportClaims = {isRequestApprover: roles.some(i => i.code === 'request_approver'), isSupportUser: roles.some(i => i.code === 'support_user')}; if (!supportClaims || !supportClaims.isSupportUser) { checkSessionAndRedirect(); @@ -147,4 +147,4 @@ const init = async (app) => { module.exports = { init, -}; \ No newline at end of file +};