Bad Redirect After Login
-
Hi. First, thanks for a great plugin! Second, I’ve been running into an issue with the redirect after the user logs into WordPress. WordPress lives at https://somedomain.org/blog, so I’ve configured my OAuth2 client (the oauth2 Ruby gem) in the following way:
site: https://somedomain.org
authorize_url: /blog/oauth/authorizeWhen I access the generated authorization url, it reaches the plugin, which redirects to the WordPress login form just fine. However, the path of the URL that is given to the form by your plugin is https://somedomain.org/blog/blog/oauth/authorize. The doubled up “blog” causes a 404 when I submit the form.
The line that seems to be the source of the trouble is this one from class-wo-api.php:
wp_redirect( wp_login_url( site_url( $_SERVER[‘REQUEST_URI’] ) ) );
The site URL configured by WordPress is https://somedomain.org/blog. The authorize URL is /blog/oauth/authorize. These get concatenated together by site_url. I’ve worked around the issue by just removing the site_url call.
Do the developers have any better suggestions?
- The topic ‘Bad Redirect After Login’ is closed to new replies.