Hi,
I started migration of Auth0 rules to actions. We have first rule called linkAccountsWithSameEmailAddress. This rule is for linking users with the same email. For example if provider is auth0 and then also google-oauth2 with the same user, rule concatenate both users to one (and auth0 always as primary).
Link to whole code pastebin. In the end of the rule, we set auth0 user (in code named dbUser
) for the other rules as primary. This user is used in the rest rules.
We are also updating user.email_verified
and user.app_metadata.is_signup
.
// set db user as main user for remaining rules
user = dbUser;
// reset signup state
user.email_verified = true;
user.app_metadata = user.app_metadata || {};
user.app_metadata.is_signup = false;
return callback(
null,
user,
{
...context,
socialUserId,
primaryUserId,
linked: true
}
);
How to do the same in actions (update entireevent.user
from first action for rest of the actions)?
Thank you.