# How to use Actions to block signup based on email domain from a social connection?

**URL:** <https://community.auth0.com/t/how-to-use-actions-to-block-signup-based-on-email-domain-from-a-social-connection/102120>\
**Category:** Get Help\
**Tags:** google-social-connection, connections\
**Created:** [March 9, 2023, 1:28am UTC](https://community.auth0.com/t/how-to-use-actions-to-block-signup-based-on-email-domain-from-a-social-connection/102120 "2023-03-09T01:28:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jesse2](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jesse2/32/13539_2.png) [@jesse2](https://community.auth0.com/u/jesse2)\
**Post date:** [March 9, 2023, 1:28am UTC](https://community.auth0.com/t/how-to-use-actions-to-block-signup-based-on-email-domain-from-a-social-connection/102120/1 "2023-03-09T01:28:25Z")

</div>

Hi,

I used a script in the PreUserRegistration Action flow to do the following: blocking signup from subsequent users from the same private email domain as an existing team.

The action worked quite well for Database connection signups.

I have just realised since testing then reading [this post](https://community.auth0.com/t/preregistration-action-is-not-triggered-after-a-social-login/72720) - that social connections do not run through the pre-user-registration action flow.

Why?

How can I build this feature (to block signup with certain conditions pertaining the email address )using actions if social connections (Google workspace accounts, for example) are skipped?

My first thought is that I’ll simply have to go back to using Rules which run every time and are quite robust.

Cheers,  
Jesse

---

<div class="post-metadata">

**Author:** ![nathan.jenkins](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nathan.jenkins/32/44577_2.png) [@nathan.jenkins](https://community.auth0.com/u/nathan.jenkins)\
**Post date:** [March 10, 2023, 11:16pm UTC](https://community.auth0.com/t/how-to-use-actions-to-block-signup-based-on-email-domain-from-a-social-connection/102120/2 "2023-03-10T23:16:07Z")

</div>

Hi @jesse2,

Unfortunately the Pre User Registration Action can only be used with Database and Passwordless connections, as detailed [here in our docs](https://auth0.com/docs/customize/actions/flows-and-triggers/pre-user-registration-flow#pre-user-registration)

You could still use Actions to block users from a social connection based on email domain but this would need to be built as a [Post Login Action](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow). So the user would first authenticate with the social provider but on returning to your application you can disallow access to your app. Here is an example of an action used to [deny access based on email domain](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow#access-control).  
I hope this info help, thanks!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 24, 2023, 11:16pm UTC](https://community.auth0.com/t/how-to-use-actions-to-block-signup-based-on-email-domain-from-a-social-connection/102120/3 "2023-03-24T23:16:54Z")

</div>

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