This rule works and custom claims are set to idToken
function (user, context, callback) {
var namespace = "https://schemas.ysera.com/";
user.user_metadata = user.user_metadata || {};
context.idToken[namespace + "user_metadata"] = user.user_metadata;
callback(null, user, context);
}
but once I migrated to Action, this custom claim stopped working
exports.onExecutePostLogin = async (event, api) => {
const namespace = "https://schemas.ysera.com/";
api.idToken.setCustomClaim(`${namespace}user_metadata`, event.user.user_metadata || {});
return;
};
Anyone sees as to why Action doesnt work? As soon as I enable the Rule my login flow works. Action doesn’t.