Hi,
I’m in the process of migrating our rules/hooks to the new actions / flows. We are using a rule which removes white spaces from given and family name. This works pretty well, but with the new action and flow approach, I can not find a solution for this. And: no, using our backend to edit those data via Management API is not a real solution.
What’s doable is something like this:
exports.onExecutePostLogin = async (event, api) => {
const family_name = event.user.family_name || event.user.last_name || "anonymous";
api.user.setAppMetadata("family_name", family_name.trim());
const given_name = event.user.given_name || event.user.first_name || "anonymous";
api.user.setAppMetadata("given_name", given_name.trim());
};
I have seen several other users here in the forum who also have to edit data in the user’s root (but for different reasons). Is this feature still to come? Or is there already a solution but I just couldn’t find it?