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
The pre 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 as stated in the Post User Registration Flow documentation:
“The post-user-registration
triggers runs after a user has been created for a Database or Passwordless connection.”:
Instead, implement this logic in a post-login action flow and 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. When this is true, trigger custom code as needed.