Skip to content

fix: use subsite URL for post-login redirects on Multisite - #966

Merged
kishore7snehil merged 2 commits into
6.xfrom
fix/multisite-login-redirect
Sep 23, 2026
Merged

kishore7snehil merged 2 commits into
6.xfrom
fix/multisite-login-redirect

Conversation

@kishore7snehil

@kishore7snehil kishore7snehil commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

On WordPress Multisite subdirectory installs, the plugin redirects to / after login,
which always resolves to the network root site. Users logging into a subsite end up on
the wrong site after Auth0 authentication. The logout path already uses get_site_url()
correctly - this aligns the login paths with the same pattern.

Changes

  • src/Actions/Authentication.php - onLogin(): replaced hardcoded '/' fallback with get_site_url() in the success redirect, error redirect, and already-authenticated redirect paths
  • src/Actions/Authentication.php - onExchangeFailed(): replaced hardcoded '/' with get_site_url()

References

Closes #963

Testing

Tested manually in a Docker Multisite subdirectory setup (auth0-PHP 9.x, WordPress 7.0,
PHP 8.4) with a subsite at /subsite-a/

Checklist

  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not the default branch

@kishore7snehil
kishore7snehil requested a review from a team as a code owner September 22, 2026 11:25
# Conflicts:
#	src/Actions/Authentication.php
@kishore7snehil
kishore7snehil merged commit 783313b into 6.x Sep 23, 2026
1 check passed
@kishore7snehil
kishore7snehil deleted the fix/multisite-login-redirect branch September 23, 2026 19:06
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.

2 participants