# Disable Social Sign Ups

**URL:** <https://community.auth0.com/t/disable-social-sign-ups/101987>\
**Category:** Get Help\
**Tags:** signup-prompt-new-experience, login-experience\
**Created:** [March 7, 2023, 12:13pm UTC](https://community.auth0.com/t/disable-social-sign-ups/101987 "2023-03-07T12:13:02Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![joe7](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@joe7](https://community.auth0.com/u/joe7)\
**Post date:** [March 7, 2023, 12:13pm UTC](https://community.auth0.com/t/disable-social-sign-ups/101987/1 "2023-03-07T12:13:02Z")

</div>

I have tried using the ‘Disable Social Sign Up’ rule as [written here](https://community.auth0.com/t/remove-social-sign-ups-from-universal-login-but-still-allow-logins/92263) but am still able to create a new user and log in via a Google account with this new user. I also noticed that some have said about using the new ‘Actions’ to achieve this, but I have no idea what I need to write. I assume it is the `onExecutePreUserRegistration` function I want to use and can see that there is some code to [prevent registration by location](https://auth0.com/docs/customize/actions/flows-and-triggers/pre-user-registration-flow) But what would I write to prevent user sign up from a Google account?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [March 8, 2023, 7:23pm UTC](https://community.auth0.com/t/disable-social-sign-ups/101987/3 "2023-03-08T19:23:42Z")

</div>

Hi @joe7,

Thanks for reaching out to the Auth0 Community!

To better help you, could you please clarify if you would like to disable the Google connection sign-up but allow logins?

Or would you prefer to have the Google Social connection disabled?

I am looking forward to your reply.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![joe7](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@joe7](https://community.auth0.com/u/joe7)\
**Post date:** [March 9, 2023, 10:28am UTC](https://community.auth0.com/t/disable-social-sign-ups/101987/4 "2023-03-09T10:28:08Z")

</div>

Hi @rueben.tiow, I am looking to disable the Google connection sign-up but still allow Google logins.  
We have users who are already signed up to the app and they use Google to sign in to their account, and we want to continue to allow them access. However, we want to prevent any new sign-ups.

Thanks

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [March 9, 2023, 8:50pm UTC](https://community.auth0.com/t/disable-social-sign-ups/101987/5 "2023-03-09T20:50:42Z")

</div>

Hi @joe7,

Thank you for your response and clarification.

This should be possible with the script shared in [this FAQ](https://community.auth0.com/t/remove-social-sign-ups-from-universal-login-but-still-allow-logins/92263). I have tested this on my end and got it to work.

I know you mentioned that it did not work for you. Because of that, could you please send me a direct message with your tenant’s name to investigate further?

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![joe7](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@joe7](https://community.auth0.com/u/joe7)\
**Post date:** [March 9, 2023, 10:10pm UTC](https://community.auth0.com/t/disable-social-sign-ups/101987/6 "2023-03-09T22:10:46Z")

</div>

Thanks @rueben.tiow, I’ve sent a direct message

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [March 13, 2023, 7:53pm UTC](https://community.auth0.com/t/disable-social-sign-ups/101987/7 "2023-03-13T19:53:25Z")

</div>

Hi @joe7,

Thank you for your direct message and updates.

I have inspected your tenant and found that your **Disable social signups** rule did not specify the Client ID on line 2.

The line of code that needs to be changed:

```auto
const CLIENTS_ENABLED = ['REPLACE_WITH_YOUR_CLIENT_ID'];

```

In this situation, I recommend replacing the dummy value with your Client ID for this to work properly.

Could you please give it a try and let me know how this goes for you?

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![joe7](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@joe7](https://community.auth0.com/u/joe7)\
**Post date:** [March 13, 2023, 10:23pm UTC](https://community.auth0.com/t/disable-social-sign-ups/101987/8 "2023-03-13T22:23:44Z")

</div>

Oh dear, I don’t know how I missed that! Yes that is all working thank you.

---

<div class="post-metadata">

**Author:** ![joe7](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@joe7](https://community.auth0.com/u/joe7)\
**Post date:** [March 15, 2023, 2:03pm UTC](https://community.auth0.com/t/disable-social-sign-ups/101987/9 "2023-03-15T14:03:11Z")

</div>

Hi @rueben.tiow, this is working as expected, I was wondering though if it is possible to redirect a user if they try and sign up?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [March 15, 2023, 5:27pm UTC](https://community.auth0.com/t/disable-social-sign-ups/101987/10 "2023-03-15T17:27:32Z")

</div>

Hi @joe7,

Thank you for your reply.

I’m glad that everything is working as expected now 👏!

Unfortunately, it is not possible to redirect a user during a Post User Registration flow.

However, there is a way to make this work in a Post-Login flow.

For some context, whenever a user signs up successfully on your application, they immediately proceed with logging in. This would increment their login count from 0 to 1. Knowing this, we can write a script that checks if their login\_count equals 1. If so, we can deduce that it is a new user.

For example, with a Rule:

```auto
function (user, context, callback) {
  if(context.stats.loginsCount === 1){
    context.redirect = {
      url: "https://example.com/foo"
    }
  }
  callback(null, user, context);
}

```

(Reference: [Redirect Users from Within Rules](https://auth0.com/docs/customize/rules/redirect-users))

I hope this helps!

Please let me know if you have any additional questions.

Thanks,  
Rueben

---

<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 29, 2023, 5:27pm UTC](https://community.auth0.com/t/disable-social-sign-ups/101987/11 "2023-03-29T17:27:38Z")

</div>

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