Auth0 Home Blog Docs

Sign in not documented when changing primary user in a rule


#1

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.


Documentation is wrong about changing user in rules
#2

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.


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.


Prevent ADFS users login if they are not registered