mrminet
Forum Replies Created
-
Forum: Plugins
In reply to: [WP OAuth Server (OAuth Authentication)] I think there is a bug!Hello there,
I have the same problem on an old website.
For this one, we’re mainly using WordPress for the authentification : We just have a login page with Wp Oauth Server, then we redirect to another part without WordPress.Here are my environnements :
– Test Server :
WordPress v5.2.2 with WP OAuth Server – Full v3.8.1
– Production Server :
WordPress v4.6.6 with WP OAuth Server – Full v3.2.86(Same problem with WP 4.6.6 & WP oAuth Server – Full v3.8.1 on Test Server)
After some researches in code, trying to change our urls, our params, or understanding if someone has created a weird .htaccess in production to handle the problem, we found out the same modification as @ptrempe has shown.
With
wp_redirect( wp_login_url( site_url( $_SERVER[‘REQUEST_URI’] ) ) );
My url on login page is:
mywebsite.com/myauth/wp-login.php?redirect_to=%2Fmyauth%2myauth%2Foauth…With
wp_redirect( wp_login_url( $_SERVER[‘REQUEST_URI’] ) );
My url on login page is:
mywebsite.com/myauth/wp-login.php?redirect_to=%2Fmyauth%2Foauth…In first case, we are on a classic WP 404 not found.
In second case, we are on the other application part, as desired.The only solution we have right now is to remove “site_url” in wp-content/plugins/wp-oauth-server/library/class-wo-api.php but that’s absolutely not a long-term solution…
So if you have a better way to solve this, it would be huge !
Thanks 🙂