Skip to content

User properties when changing context.primaryUser #148

@matthieusieben

Description

@matthieusieben

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) ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions