import { ScopeContext } from '../../common/types' ; const aliasScopesClaims = { chorusdt : [ 'chorusdt:matricule' , 'chorusdt:societe' ] , openid : [ 'sub' ] , phone : [ 'phone_number' ] , } ; param scopeContext returns export const getClaims = ( scopeContext ) : string [ ] => { const { scopes } = scopeContext ; const claims = scopes . map ( ( scope ) : string => aliasScopesClaims [ scope ] ? aliasScopesClaims [ scope ] : scope ) . flat ( ) ; return [ ... new Set ( claims ) ] ; } ;