Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Bootloader: Bail early on wp-login.php/wp-admin, and some other /wp- requests #339

Merged
merged 5 commits into from
Feb 1, 2024

Conversation

retlehs
Copy link
Sponsor Member

@retlehs retlehs commented Feb 1, 2024

  • Fix wp-login.php
  • Fix wp-admin / admin-ajax.php requests
  • Fix other requests? wp-comments-post.php, wp-signup.php?

Fix #337

@retlehs retlehs marked this pull request as draft February 1, 2024 20:48
@retlehs retlehs changed the title 馃悰 Bootloader: Bail early on wp-login.php requests 馃悰 Bootloader: Bail early on wp-login.php / wp-admin requests Feb 1, 2024
@retlehs retlehs marked this pull request as ready for review February 1, 2024 21:00
@retlehs retlehs changed the title 馃悰 Bootloader: Bail early on wp-login.php / wp-admin requests 馃悰 Bootloader: Bail early on wp-login.php/wp-admin, and some other /wp- requests Feb 1, 2024
@dsturm
Copy link
Sponsor Contributor

dsturm commented Feb 1, 2024

Thanks for starting a fix so quickly.

I also noticed that there were problems with REST queries in the block editor. But I'm not sure if it's just the cookie not being set.

@retlehs
Copy link
Sponsor Member Author

retlehs commented Feb 1, 2024

Pushed an update that should fix those I think? If not, do you mind showing which requests are failing for you still?

I've tested on:

  • The roots.io site
  • Radicle setup
  • Stock Bedrock/Acorn/Sage setup

@dsturm
Copy link
Sponsor Contributor

dsturm commented Feb 1, 2024

@retlehs Worked for me! Thank you 馃挭

Copy link
Sponsor Member

@QWp6t QWp6t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! :shipit:

@QWp6t QWp6t merged commit 74671f1 into main Feb 1, 2024
2 checks passed
@QWp6t QWp6t deleted the router-wp-login branch February 1, 2024 22:52
@dr5hn
Copy link
Contributor

dr5hn commented Feb 5, 2024

@QWp6t //cc @retlehs Doesn't work if we've hided login behind some custom path.

Can we pass a custom path using config?

@retlehs
Copy link
Sponsor Member Author

retlehs commented Feb 5, 2024

@dr5hn Does login_url() return the correct URL on your setup?

@dr5hn
Copy link
Contributor

dr5hn commented Feb 5, 2024

@retlehs Yes it return the hidden admin path url.

https://x***x.com/secret/

When i make this change, login works!

diff --git a/src/Roots/Acorn/Bootloader.php b/src/Roots/Acorn/Bootloader.php
index fc0e8c9..b57adfc 100644
--- a/src/Roots/Acorn/Bootloader.php
+++ b/src/Roots/Acorn/Bootloader.php
@@ -266,6 +266,7 @@ class Bootloader
             '/wp-login.php',
             '/wp-signup.php',
             '/wp-admin/',
+            '/secret/'
         ])) {
             return; // Let WordPress handle these requests
         }

Adding this dynamic path will get this working

parse_url(wp_login_url(), PHP_URL_PATH),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Changes to WordPress routes break the wp-admin login
5 participants