Checklist
Description
Several code paths hardcode wp_redirect('/') instead of resolving the current site's URL. On a Multisite subdirectory install, an absolute / always resolves to the network's root site, not the subsite the user is actually logging into. onLogout() gets this right (passes get_site_url(), which is subsite-aware) but the login/exchange paths don't.
Reproduction
- Set up WordPress Multisite in subdirectory mode with at least one non-root subsite.
- Configure and activate the plugin network-wide.
- Log in on
example.com/subsite-a/wp-login.php.
- Observe the redirect lands on
example.com/ (network root) instead of example.com/subsite-a/.
Additional context
// onLogin() success, ~539 / error, ~546 / already-authenticated, ~551
wp_redirect('/');
// onExchangeFailed(), ~562
wp_redirect('/');
Related: #935, closed as stale without a confirmed root cause. Suggested fix: use admin_url() or get_site_url() in all four locations, matching onLogout().
wp-auth0 version
5.6.1
WordPress version
7.1
PHP version
8.4
Checklist
Description
Several code paths hardcode
wp_redirect('/')instead of resolving the current site's URL. On a Multisite subdirectory install, an absolute/always resolves to the network's root site, not the subsite the user is actually logging into.onLogout()gets this right (passesget_site_url(), which is subsite-aware) but the login/exchange paths don't.Reproduction
example.com/subsite-a/wp-login.php.example.com/(network root) instead ofexample.com/subsite-a/.Additional context
Related: #935, closed as stale without a confirmed root cause. Suggested fix: use
admin_url()orget_site_url()in all four locations, matchingonLogout().wp-auth0 version
5.6.1
WordPress version
7.1
PHP version
8.4