It was the problem is what I was running into and this rule solved it. The problem is rules are going away and I can’t figure out how to convert it from the rule listed into an action. My feeble attempts have so far failed to net the same result.
Well I think between me and an AI bot were able to come up with this after some creative prompting. After a few tests I am pretty sure it’s working as the old rule did.
So I’ll put it here for anyone else who finds the old rule post and is wondering how to do it in new actions.
exports.onExecutePostLogin = async (event, api) => {
// Set the preferred_username in the ID token
api.idToken.setCustomClaim(“preferred_username”, event.user.username);
};