remyperona / wps-hide-login

WPS Hide Login
41 stars 19 forks source link

Issue with User Switching & WP in custom directory #29

Open dademaru opened 2 years ago

dademaru commented 2 years ago

Hi,

I'm facing an issue with WP installed in its own custom directory (e.g. /wp) and the User Switching plugin.

When switching to another user (e.g from admin to editor) and trying to switch back, I get the error:

Could not switch users.

Steps to reproduce:

  1. Install WP in custom directory (e.g. /wp)
  2. Install & activate User Switching plugin
  3. Install & activate WPS Hide Login plugin
  4. Add editor user
  5. Click 'Switch to' link below editor username
  6. Click 'Switch back to admin' link in admin notice or user menu.

By deactivating WPS Hide Login it works as expected.

The switch action posted to wp-login.php is switch_to_olduser.

The URL without WPS Hide Login is: https://test.dev/wp/wp-login.php?action=switch_to_olduser&nr=1&_wpnonce=xxx&redirect_to=https%3A%2F%2Ftest.dev%wp%2Fwp-admin%2F%3Fuser_switched%3Dtrue

with WPS Hide Login activated: https://test.dev/login/?action=switch_to_olduser&nr=1&_wpnonce=xxx&redirect_to=https%3A%2F%2Ftest.dev%wp%2Fwp-admin%2F%3Fuser_switched%3Dtrue

Note: with WP installed in the root it works as expected.

Thanks