• Resolved iNexi

    (@inexi)


    I believe there is a bug in the example for a Custom Login Page. The exit; should be contained within the if statement. As written it causes a Custom Login page to never redirect back to the oAuth client site.

    A second bug in the same example regards the redirect_to query variable. The URL should be URL encoded, since there will be multiple query variables with every credential auth redirect.

    Here’s my working, updated code:

    //Redirect a user to a custom login page for authentication
    add_action( 'wo_before_authorize_method', function () {
    	if ( ! is_user_logged_in() ) {
    		wp_redirect( site_url() . '/custom-login/?redirect_to=' .urlencode( site_url() . $_SERVER['REQUEST_URI'] ) );
    		exit;
    	}
    });

    This affects the Docs page, and the examples.php file.

    • This topic was modified 5 years, 6 months ago by iNexi.

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

Viewing 1 replies (of 1 total)
  • Plugin Author Justin Greer

    (@justingreerbbi)

    Thank you for your effort and thank you for reporting this. I have updated both instances of the example code.

Viewing 1 replies (of 1 total)
  • The topic ‘Documentation Error’ is closed to new replies.