Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter sjwt

    (@sjwt)

    Thanks for letting me know the problem is not unique to me.
    I spent some time a few days ago and have figured out the issue.
    After login, the plugin will try to redirect the page to wp_get_referer().
    However, I don’t know why that function returns a empty string.

    Here is my workaround.
    Edit the file: wordpress-2-step-verification/wordpress-2-step-verification.php
    Modify the function: code_check_ok() to following

    function code_check_ok(){
            $remember=$this->post('wp2sv_remember');
            $this->cleanup_restriction();
            $this->auth->set_cookie($this->user_id,$remember);
            if ( wp_get_referer() ) {
        		wp_safe_redirect( wp_get_referer() );
    	} else {
        		wp_safe_redirect( get_home_url().$_SERVER["REQUEST_URI"] );
    	}
    	exit;
            die;
     }

    Essentially the workaround just tries to use another approach to get a redirect url if the wp_get_referer() is empty. It works well for me.

Viewing 1 replies (of 1 total)