So we have this rule that merges a user logging-in into a previously existing identity. As explained in #71, context.primaryUser must be update accordingly in that particular case.
But it is kinda wiered and unclear what happens next when calling callback(null, user, context) with user being the user that was merged into the previous account (the original user that was used to call the rule).
- More specifically, what will be the
user_id of the user in the next rule ?
- Do we need to update all the properties of
user (user.app_metadata, user.user_metadata, user.first_name, etc.) with those of the primary user before calling the next rule, or will Auth0 automatically reload the properties of user if context.primaryUser has changed ?
- Why shouldn't we call
callback(null, otherPrimaryUser, context) (I have the impression that this will cause an Unable to construct sso user. error in some cases, but I can't figure out when) ?
So we have this rule that merges a user logging-in into a previously existing identity. As explained in #71,
context.primaryUsermust be update accordingly in that particular case.But it is kinda wiered and unclear what happens next when calling
callback(null, user, context)withuserbeing the user that was merged into the previous account (the originaluserthat was used to call the rule).user_idof the user in the next rule ?user(user.app_metadata,user.user_metadata,user.first_name, etc.) with those of the primary user before calling the next rule, or will Auth0 automatically reload the properties ofuserifcontext.primaryUserhas changed ?callback(null, otherPrimaryUser, context)(I have the impression that this will cause anUnable to construct sso user.error in some cases, but I can't figure out when) ?