• Resolved shorio

    (@shorio)


    Our site has a problem of robot registering to our site. Is there a way to restrict access to that so that only calls from Auth0 would be allowed.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • @shorio – Is this happening through the default WordPress registration? We’ve considered blocking that but it might have unintended effects (i.e. other plugins using that path would fail). Issue is here:

    https://github.com/auth0/wp-auth0/issues/286

    You could use the login_init hook to catch POST requests to action=register and redirect back to the login page. Something like this:

    
    add_action( 'login_init', 'shorio_redirect_register_post_requests', 1 );
    function shorio_redirect_register_post_requests() {
    	$is_register = isset( $_GET['action'] ) && 'register' === $_GET['action'];
    	$http_method = strtolower( $_SERVER['REQUEST_METHOD'] );
    	if ( $is_register && 'get' === $http_method ) {
    		wp_safe_redirect( wp_login_url() );
    		exit;
    	}
    }
    

    Not tested, FYI, but that should do the trick (or get close). That will drop someone back on the login page with the Lock widget showing.

    • This reply was modified 7 years, 8 months ago by Josh C.
Viewing 1 replies (of 1 total)

The topic ‘Creating registration restriction’ is closed to new replies.