We have existing functionality that lets users “link” social accounts. For example, if user A logs in, then they can navigate to a page and manually link their social accounts. With Auth0, we decided to use the link and unlink management API to link users as the extension would be new functionality.
It depends on which account you are setting as the primary user vs secondary user.
If the user signs up with their Facebook account and it is set as the primary user during account linking, the user should remain logged in as the new facebook account they just signed up with.
If the user signs up with their Facebook account, but firstname.lastname@example.org is set as the primary user, you must also set and return email@example.com as the event.user in the Action. This will let the authentication flow continue for the user and allow them to be remained logged in, but as the original firstname.lastname@example.org account.
Note: I’ve only done this for Auth0 Rules, but for Auth0 Actions please reference this previous community post - specifically the part about returning the “new” primary user in the update