Can Social Login verify that an email already exists as a user name before allowing Google sign on?

We have a restricted Wordpress site, and we are downloading our users from our Zendesk account. To log in, users must use their email address as their user name (as defined in Zendesk). I added the Social Login plugin to allow users to log in using a Google account; however, we want to prevent users from logging in with an email address that does not match an email address that already exists in Wordpress. Is there a way to accomplish this? Thank you.

Best Answer

  • Claude_SchlesserClaude_SchlesserAdministratorOneAll Team
    edited August 2016 Answer ✓
    Hi Cheryl,

    Please first make sure that you have enabled the following option in the social logins settings:

    If the user's social network profile has a verified email, should we try to link it to an existing account?

    Then add the following code to the end of the functions.php file of your WordPress theme to disable the registration of new users.


    //This function will be called before Social Login adds a new user function oa_social_login_do_before_user_insert ($user_data, $identity) { die("Registration forbidden"); } add_action ('oa_social_login_action_before_user_insert', 'oa_social_login_do_before_user_insert', 10, 2);


    You should replace the line die("Registration forbidden"); by a more meaningful message ;)

    Welcome!

    Please sign in to your OneAll account to ask a new question or to contribute to the discussions.

    Please click on the link below to connect to the forum with your OneAll account.