Documentation Error
-
I believe there is a bug in the example for a Custom Login Page. The
exit;
should be contained within theif
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.
The page I need help with: [log in to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Documentation Error’ is closed to new replies.