Skip to content

poc: Hono + Better Auth integration playground#450

Draft
nhyiramante1 wants to merge 2 commits into
mainfrom
poc/better-auth-hono
Draft

poc: Hono + Better Auth integration playground#450
nhyiramante1 wants to merge 2 commits into
mainfrom
poc/better-auth-hono

Conversation

@nhyiramante1

Copy link
Copy Markdown
Contributor

What this is

A self-contained playground (playgrounds/better-auth-hono/) proving that Better Auth can be layered onto the Hono backend shape introduced in PR #448.

This does not modify any production code. No changes to backend/, frontend/, experiment/, or any deployment config.

Milestones - all passing

  • M1 - Better Auth mounts at /api/auth/* inside a Hono server
  • M2 - Google OAuth completes end-to-end (redirect to callback to session cookie)
  • M3 - Session verification works in Hono route handlers: cookie 200, no auth 401, Bearer token 200
  • M4 - Auth guard works in front of a mock OpenAI-compatible SSE route

Why this matters for PR #448

PR #448 explicitly defers auth. This playground answers the follow-on question: when the team is ready to add auth to the Hono backend, what does that look like?

INTEGRATION.md maps the exact changes needed:

  • add backend/src/auth.ts
  • one-line mount of /api/auth/* inside createApp()
  • tighten CORS (credentials: true, locked origin)
  • two-line session guard on /api/openai/chat/completions

Not in scope

Logging, PostHog, Docker, real OpenAI calls, JWT plugin - PR #448 owns that territory.

nhyiramante1 and others added 2 commits June 4, 2026 10:58
Proves Better Auth can be layered onto the Hono backend shape introduced
in PR #448. All four milestones pass: server boots, Google OAuth completes,
session verification works (cookie + Bearer), and the mock auth-gated SSE
route works.

Includes INTEGRATION.md mapping exactly how to add auth.ts, mount
/api/auth/*, tighten CORS, and guard /api/openai/chat/completions in
the PR #448 backend with minimal changes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kcarnold kcarnold marked this pull request as ready for review June 12, 2026 20:27
@kcarnold kcarnold marked this pull request as draft June 12, 2026 20:27
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