Skip to content

Prevent login redirect plugins from breaking OAuth flow#289

Merged
akirk merged 3 commits intomainfrom
fix/oauth-login-redirect
Mar 26, 2026
Merged

Prevent login redirect plugins from breaking OAuth flow#289
akirk merged 3 commits intomainfrom
fix/oauth-login-redirect

Conversation

@akirk
Copy link
Copy Markdown
Owner

@akirk akirk commented Mar 26, 2026

Summary

  • Login redirection plugins (Jetpack SSO, Paid Memberships Pro, etc.) override the redirect_to parameter after login, sending users to the WordPress dashboard instead of back to the OAuth authorization screen
  • Hooks into login_redirect at 999 priority and restores the original redirect_to when it contains our enable-mastodon-apps-authenticate action
  • Only affects logins that are part of the OAuth flow — all other logins remain untouched

Fixes #180

Test plan

  • Test OAuth flow with a login redirect plugin active (e.g. Jetpack SSO, Paid Memberships Pro)
  • Verify normal WordPress login redirects are not affected
  • Test with Mastodon for iOS, Ivory, and the built-in tester

akirk added 3 commits March 26, 2026 10:12
Login redirection plugins (Jetpack SSO, Paid Memberships Pro, etc.)
override the redirect_to parameter after login, sending users to the
dashboard instead of back to the OAuth authorization screen.

Hook into login_redirect at maximum priority and restore the original
redirect when it contains our OAuth action parameter.
@akirk akirk merged commit d67d671 into main Mar 26, 2026
17 checks passed
@akirk akirk deleted the fix/oauth-login-redirect branch March 26, 2026 09:27
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.

Landing on Dashboard after authorisation, not in Mastodon app

1 participant