Skip to main content

vibeApiOauth

Flow:

  1. User clicks Connect button
  2. Extension opens portal.vibebrowser.app/auth via chrome.identity.launchWebAuthFlow()
  3. User authenticates (Google or email magic link)
  4. Portal generates auth code and redirects back to extension
  5. Extension exchanges code + code_verifier for API key
  6. Connection complete - popup closes automatically

Files Changed:

FileChange
oauth.tsAdded Vibe config with PKCE (like OpenRouter)
vibeAuth.tsSimplified to ~130 lines, uses OAuth flow
user-portal/server.jsAdded /api/auth/code and /api/auth/token endpoints
user-portal/public/auth.htmlAuth page handles callback_url, code_challenge, state
SettingsPage.tsxDefault model vibe:gpt-5-mini, clean error handling

Architecture:
Extension Portal Backend
| | |
|--launchWebAuthFlow------->| |
| (callback_url, challenge)| |
| |--Supabase Auth----------->|
| |<--Session-----------------|
| |--POST /api/auth/code----->|
| |<--{ code }----------------|
|<--redirect?code=xxx-------| |
|--POST /api/auth/token---->|-------------------------->|
| (code, code_verifier) | |
|<--{ key: "sk-..." }-------|<--------------------------|
| | |

YO