Actions not triggered with social login

Problem statement

When a user attempts to log in for the first time using a Social or Enterprise connection, the pre-registration and post-registration actions configured in the tenant are not triggered. What is the reason for this behavior?

Cause

As mentioned in the trigger documentation, these will only run for Database or Passwordless connection types.

Solution

Unfortunately, Pre User Registration and Post User Registration actions can only be used in conjunction with Database and Passwordless type connections, they will not be triggered for Social or Enterprise connections.

“The post-user-registration triggers runs after a user has been created for a Database or Passwordless connection.”:

Instead, you would need to implement this logic in a Post Login flow - you could use the “event.stats.logins_count” combined with the “event.connection.name” for example to see if this is the user signing in for the first time with a social connection and trigger your custom code.

You could also use a custom app_metadata field to track whether an email has been sent to a social connection user if you needed to carry this out retrospectively.

1 Like