Skip to content

Fixing oauth flow on chat example #27

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
merged 10 commits into from
Jul 16, 2025
Merged

Fixing oauth flow on chat example #27

merged 10 commits into from
Jul 16, 2025

Conversation

geelen
Copy link
Collaborator

@geelen geelen commented Jul 16, 2025

No description provided.

geelen and others added 10 commits July 11, 2025 16:47
Previously, the PKCE flow stored multiple keys with timestamps (pkce_${providerId}_${timestamp})
and had complex logic to find the most recent key. This simplified implementation:

- Changes storage key format from `pkce_${providerId}_${timestamp}` to `pkce_${providerId}`
- Removes timestamp-based key sorting logic in completeOAuthFlow()
- Ensures only one PKCE key is stored per provider at any time
- Eliminates potential race conditions with multiple concurrent auth flows
- Simplifies debugging by having predictable key names

This applies to both OpenRouter and Groq OAuth flows. Also fixes TypeScript
build error by removing unused 'state' variable in OAuthCallback component.

Amp-Thread: https://ampcode.com/threads/T-12223468-a950-40a8-9d44-2e1a66e6efbe
Co-authored-by: Amp <amp@ampcode.com>
@geelen geelen changed the title Fixing oauth flwo Fixing oauth flow Jul 16, 2025
@geelen geelen changed the title Fixing oauth flow Fixing oauth flow on chat example Jul 16, 2025
@geelen geelen merged commit c3ee0e9 into main Jul 16, 2025
7 checks passed
Copy link

pkg-pr-new bot commented Jul 16, 2025

Open in StackBlitz

npx https://pkg.pr.new/modelcontextprotocol/use-mcp@27

commit: d80e9f4

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.

1 participant