Skip to content

[Fix] [Studio]: route cancelled oauth flows back to login page - #199

Merged
Gautam25Raj merged 1 commit into
masterfrom
fix/oauth-cancellation-redirect
Sep 13, 2026
Merged

Gautam25Raj merged 1 commit into
masterfrom
fix/oauth-cancellation-redirect

Conversation

@Gautam25Raj

Copy link
Copy Markdown
Collaborator

Description

When a user cancels GitHub or LinkedIn authorization, Better Auth looks for an errorCallbackURL. Because one was not passed in SocialAuth.tsx, it defaulted to ${baseURL}/error, redirecting users to the raw backend API domain (api.veriworkly.com).

This change:

  • Passes an explicit errorCallbackURL pointing to ${window.location.origin}/login?error=cancelled when calling authClient.signIn.social(...).
  • Checks for error query parameters on /login, shows a "Sign in was cancelled" notification, and removes the parameters from the URL bar without a page reload.

Linked Issue

Fixes #198

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📝 Documentation update
  • 🧪 Tests (adding or updating tests)

Checklist

  • I have read the CONTRIBUTING.md document.
  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.

@Gautam25Raj
Gautam25Raj merged commit fe9ca49 into master Sep 13, 2026
8 of 11 checks passed
@Gautam25Raj
Gautam25Raj deleted the fix/oauth-cancellation-redirect branch September 13, 2026 11:15
@Gautam25Raj Gautam25Raj added bug Something isn't working frontend UI/client-side code ui/ux Design or user experience improvements labels Sep 13, 2026
@Gautam25Raj Gautam25Raj self-assigned this Sep 13, 2026
@Gautam25Raj Gautam25Raj changed the title fix(studio): route cancelled oauth flows back to login page [Fix] [Studio]: route cancelled oauth flows back to login page Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working frontend UI/client-side code ui/ux Design or user experience improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Canceling OAuth on GitHub or LinkedIn redirects to backend API instead of login page

1 participant