I set up the following and looked at every post on here related to this but I am not getting roles back in my id token on my client side app after logging in:
exports.onExecutePostLogin = async (event, api) => {
const namespace = 'https://example-api.com';
if (event.authorization) {
api.idToken.setCustomClaim(`${namespace}/roles`, event.authorization.roles);
api.accessToken.setCustomClaim(`${namespace}/roles`, event.authorization.roles);
}
}
The action is executing but the id token doesnt get the roles