Skip to content

feat: QoL improvements for OAuth Callback #279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

max-stytch
Copy link
Contributor

@max-stytch max-stytch commented Apr 7, 2025

Motivation and Context

Some improvements for the OAuth Callback:

  • Adds support for surfacing errors when the upstream IDP returns an OAuth 2.1 Auth Code error
  • Adds support for showing an error toast when the auth code exchange fails
  • Simplifies the state management and page reloading discussed in fix: Do not reconnect on rerender #253 by having the OAuthCallback take in an onConnect prop instead of communicating state via query params + full page reload

How Has This Been Tested?

Demo: https://www.loom.com/share/1e91ec76ba1e4634bb7f97a0c409b836

Use the following convenience links to force error states:

Unit tests are added for some of the minutia

Breaking Changes

Types of changes

  • 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 change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@olaservo
Copy link
Member

Thanks for opening this - fyi I'm pushing some changes for issue 321 soon, which should pair well with these types of enhancements, although I might need to make a couple more tweaks to expose specific logs or elements from the UI.

Copy link
Contributor

@cliffhall cliffhall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@max-stytch Looks good and tested locally to see the new toast. However there are conflicts to be resolved before we can merge.

Screenshot 2025-04-16 at 5 46 35 PM

@cliffhall cliffhall added enhancement New feature or request waiting on submitter Waiting for the submitter to provide more info labels Apr 16, 2025
@max-stytch
Copy link
Contributor Author

@cliffhall merge conflicts have been resolved!

Copy link
Contributor

@cliffhall cliffhall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build, test, lint, manual test all looking good.

@cliffhall cliffhall merged commit 3aa8753 into modelcontextprotocol:main Apr 17, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request waiting on submitter Waiting for the submitter to provide more info
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants