Skip to content

Migrate auth from Mukoko OAuth/PKCE to direct Stytch Consumer SDK - #9

Merged
bryanfawcett merged 1 commit into
mainfrom
claude/stytch-sdk-migration-TOkA7
Feb 13, 2026
Merged

Migrate auth from Mukoko OAuth/PKCE to direct Stytch Consumer SDK#9
bryanfawcett merged 1 commit into
mainfrom
claude/stytch-sdk-migration-TOkA7

Conversation

@bryanfawcett

Copy link
Copy Markdown
Contributor

Replace the Connected App OAuth flow through id.mukoko.com with direct
Stytch Consumer SDK integration. Users now authenticate on nhimbe.com
using email magic links or OTP instead of being redirected externally.

Frontend changes:

  • Add StytchProvider wrapping the app with Stytch's SDK context
  • Replace AuthContext to use Stytch hooks (useStytchUser, useStytchSession)
    instead of custom cookie/localStorage token management
  • Replace signin page with Stytch's pre-built StytchLogin UI component
  • Add /authenticate page for magic link token exchange
  • Add Stytch CSS overrides matching nhimbe brand colors
  • Delete OAuth route handlers (login, callback) and callback page

Backend changes:

  • Replace OAuth token validation with Stytch session JWT validation
    via POST /v1/sessions/authenticate
  • Replace /api/auth/token (OAuth code exchange) with /api/auth/sync
    (session-based user lookup/creation)
  • Remove exchangeCodeForTokens and getUserInfo OAuth helpers
  • Add revokeSession helper for server-side session revocation

https://claude.ai/code/session_01Ad3GsnUhMePaDM1eL6GhyP

Replace the Connected App OAuth flow through id.mukoko.com with direct
Stytch Consumer SDK integration. Users now authenticate on nhimbe.com
using email magic links or OTP instead of being redirected externally.

Frontend changes:
- Add StytchProvider wrapping the app with Stytch's SDK context
- Replace AuthContext to use Stytch hooks (useStytchUser, useStytchSession)
  instead of custom cookie/localStorage token management
- Replace signin page with Stytch's pre-built StytchLogin UI component
- Add /authenticate page for magic link token exchange
- Add Stytch CSS overrides matching nhimbe brand colors
- Delete OAuth route handlers (login, callback) and callback page

Backend changes:
- Replace OAuth token validation with Stytch session JWT validation
  via POST /v1/sessions/authenticate
- Replace /api/auth/token (OAuth code exchange) with /api/auth/sync
  (session-based user lookup/creation)
- Remove exchangeCodeForTokens and getUserInfo OAuth helpers
- Add revokeSession helper for server-side session revocation

https://claude.ai/code/session_01Ad3GsnUhMePaDM1eL6GhyP
@vercel

vercel Bot commented Feb 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nhimbe Ready Ready Preview, Comment Feb 13, 2026 4:29am

Request Review

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
mukoko-nhimbe-api 4c0e8dd Commit Preview URL

Branch Preview URL
Feb 13 2026, 04:28 AM

@bryanfawcett
bryanfawcett merged commit 615205a into main Feb 13, 2026
10 checks passed
@bryanfawcett
bryanfawcett deleted the claude/stytch-sdk-migration-TOkA7 branch February 18, 2026 09:56
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.

2 participants