Auth0 contains personally-identifiable information (PII) that we don’t want to share with a particular application. We do want the user to be able to log in to the application and get a valid session. I don’t want to change the actual data in Auth0, just the presentation to this client application.
Is it possible to override the PII fields on the token during the post-login flow?
I’m imagining something like
exports.onExecutePostLogin = async (event, api) => {
const { user_id: id } = event.user
api.user.setEmail(`${id}@example.com`);
api.user.setName(`Anonymous User ${id}`)
api.user.setNickname(`Anonymous`)
};
These APIs don’t actually exist. Is there something else that would accomplish this?