Hey!
I have the following situation:
We are using Authorization Extension v2.13.0 to create groups, roles, and permissions for users, since Auth0 by default doesn’t support groups.
Also, we are using this post-login action script:
exports.onExecutePostLogin = async (event, api) => {
console.log("Adding permissions claim to JWT...")
if (event.authorization) {
try {
const namespace = 'https://me.com/permissions';
api.idToken.setCustomClaim(namespace, event.user.authorization.permissions);
api.accessToken.setCustomClaim(namespace, event.user.authorization.permissions);
} catch(error) {
console.error(error);
throw new Error('Failed getting user permissions');
}
}
}
The problem is that I need to log in and log out twice so the new changes made in Authorization Extension v2.13.0 are added in event.user.authorization.permissions, probably because Auth0 is caching the permissions.
So is there a way to avoid this situation, or force the refresh of the data?
Thanks in advance!
Alvaro