Sign in not documented when changing primary user in a rule

It seems that when you change the primary user in a rule, the sign in is not documented on the user you changed to.

When a user signs in using a social connection, we create a new user with auth0 as the provider and link the social user into it (this allows us to always be able to change the primary email of a user).

The loginsCount and lastLogin on the newly created user are 0 and null.

1 Like

We use account linking in a rule and change the primary user.

The docs says you need to set context.primaryUser to the id the user got linked into.
https://github.com/auth0/rules/blob/master/rules/link-users-by-email.md

But, when doing just that the next rule still uses the previous user (which by now is non-existent, because it was linked into another user).

After trial and error it seems you also need to call the rule callback with the other user, i.e. the user the original user got linked into.

Please revisit this.

1 Like

Hey there!

Sorry for the delay in response. We’re doing our best in providing you with best developer support experience out there, but sometimes there are too many questions to handle. Sorry for the inconvenience!

Do you still require further assistance from us?