How to trigger an action when a new enterprise user is automatically added to an organization

We are using organizations, and one of our customers is using Azure Active Directory to login to our application. We are using the “Auto-Membership” feature so users from this enterprise are automatically added to the organization it is associated with. I would like to trigger an action when a user logs in for the first time and is added to the organization.

It seems like the only event that is triggered in this case is the post-login event, and there is no difference in the events between the first login when the user is added to the org and subsequent logins.

Is there a programmatic way to act on a user being added to an organization using actions?

The solution I settled on was to detect the user’s first login. It’s not ideal but it works.

if(event.stats.logins_count > 1) return Promise.resolve();

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.