Here’s my rule -
function addEmailToAccessToken(user, context, callback) {
// This rule adds the authenticated user's email address to the access token.
var namespace = 'https://logkeeper.com/';
context.accessToken[namespace + 'email'] = user.email;
return callback(null, user, context);
}
Here’s my action:
exports.onExecutePostLogin = async (event, api) => {
const namespace = 'https://logkeeper.com/'
api.accessToken.setCustomClaim(namespace + 'email', event.user.email)
};
The action doesn’t work, but the rule works fine.
What’s going on?
