• Resolved Michael Kwan

    (@michoscopic)


    Hi, I enabled Social Login with Google, and I have disabled the general WP Settings of “Anyone can register”. However I notice anyone can sign in with a Google account and auto-create WP user.

    How can I prevent this please? I only want to enable login, not register. Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Michael Kwan

    (@michoscopic)

    Currently I’m using a workaround – for “real” users that I want to allow to login, I set them as a different user role. Then I set an automatic login redirect for all [User Role = Subscriber] to [ /wp-login.php?action=logout ], and add a code in functions.php to remove the logout confirmation:

    add_action('check_admin_referer', 'logout_without_confirm', 10, 2);
    function logout_without_confirm($action, $result)
    {
        /**
         * Allow logout without confirmation
         */
        if ($action == "log-out" && !isset($_GET['_wpnonce'])) {
            $redirect_to = isset($_REQUEST['redirect_to']) ? $_REQUEST['redirect_to'] : 'url-you-want-to-redirect';
            $location = str_replace('&', '&', wp_logout_url($redirect_to));
            header("Location: $location");
            die;
        }
    }

    Source: https://wordpress.stackexchange.com/questions/67336/how-to-log-out-without-confirmation-do-you-really-want-to-log-out

    This works as a simple honeypot, and any non-authorised Google logins get force logged-out.

    But preferably I’d like to prevent auto-registration altogether. Appreciate any help, thanks.

    • This reply was modified 11 months, 2 weeks ago by Michael Kwan.
    Plugin Support Ibrahim Sharif

    (@ibrahimsharif)

    Hello @michoscopic,

    Thank you for reaching out to us. I understand your concern about preventing Social Login from creating new accounts.

    I see that you found a workaround for now.

    I can submit a feature request to our development team to explore the possibility of adding a more robust solution to prevent auto-registration via Social Login. If you have any specific suggestions on how this feature should work, please let me know.

    In the meantime, please let me know if you have any other questions or concerns.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.