use-mcp/examples/chat-ui/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Glen Maddern c3ee0e9b09
Fixing oauth flow on chat example (#27)
* wip

* Successfully getting a token from Groq!

* Simplify PKCE flow to use single key per provider

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>

* Amp getting confused

* Able to run inference against staging Groq

* The old oauth callback got clobbered, try to restore it

* Restored, but still buggy

* updated data

* Pruning Groq models

* deploying

---------

Co-authored-by: Amp <amp@ampcode.com>
2025-07-16 22:21:20 +10:00
..
components Fixing oauth flow on chat example (#27) 2025-07-16 22:21:20 +10:00
data Fixing oauth flow on chat example (#27) 2025-07-16 22:21:20 +10:00
hooks Fixing oauth flow on chat example (#27) 2025-07-16 22:21:20 +10:00
styles Adding a full chat example (#19) 2025-07-02 16:24:03 +10:00
types Fixing oauth flow on chat example (#27) 2025-07-16 22:21:20 +10:00
utils Fixing oauth flow on chat example (#27) 2025-07-16 22:21:20 +10:00
App.tsx Fixing oauth flow on chat example (#27) 2025-07-16 22:21:20 +10:00
consts.ts Adding a full chat example (#19) 2025-07-02 16:24:03 +10:00
index.css Adding a full chat example (#19) 2025-07-02 16:24:03 +10:00
main.tsx Adding a full chat example (#19) 2025-07-02 16:24:03 +10:00
vite-env.d.ts Adding a full chat example (#19) 2025-07-02 16:24:03 +10:00