I want to add the user’s email to my API access token. earlier using rules we used to do this but now since rules deprecated we have to add actions so i have created a Post-Login Action to do so:
below is the code for it i have added
exports.onExecutePostLogin = async (event, api) => {
// This rule adds the authenticated user's email address to the access token.
// This rule adds the authenticated user's email address to the access token.
if (event.authorization) {
const namespace = 'https://thepickleballwizard.com';
api.accessToken[`${namespace}/email`] = event.user.email;
}
};
above code not adding any email to access token what i am missing