Support » Plugin: User registration & user profile - Profile Builder » wp-login.php accessible with blank information

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Georgian Cocora

    (@raster02)

    Hello @erikggonc,

    This should happen by default.
    If you remove the code and try to login on our front-end page, do you remain on wp-login.php if an error is triggered ?

    Regards.

    Yes, Georgian.
    Tried to disable iThemes security and S2 Member too and the same behavior persisted.
    I don’t know if one of these plugins are interfering…
    But searching a little more, I found the solution to what I want and need: that is to take the user back to the plugin front-end page.

    Just added the complementary code:

    /* redirect invalid login script */
    function invalid_login_fail( $username ) {
         $referrer = $_SERVER['HTTP_REFERER'];
         if ( !empty($referrer) && !strstr($referrer,'wp-login') && !strstr($referrer,'wp-admin') ) {
              wp_redirect( $referrer . '?login=failed' );
              exit;
    	}
    }
    add_action( 'wp_login_failed', 'invalid_login_fail' );
    
    /* redirect blank login script */
    function blank_username_password( $user, $username, $password ) {
    	//global $page_id;
    	$login_page = 'LOGIN_PAGE_URL';
    	if( $username == "" || $password == "" ) {
    	wp_redirect( $login_page );
    	exit;
    	}
    }
    add_filter( 'authenticate', 'blank_username_password', 1, 3);

    Thank you very much for you your attention and great support!

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