Skip to content

feat(flox): add better-auth (email/password + Google), replace PasswordGate - #28

Open
cd996 wants to merge 1 commit into
mainfrom
feat/flox-auth-wepush-trendchart
Open

feat(flox): add better-auth (email/password + Google), replace PasswordGate#28
cd996 wants to merge 1 commit into
mainfrom
feat/flox-auth-wepush-trendchart

Conversation

@cd996

@cd996cd996 commented May 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds better-auth to flox and removes the old client-side password gate.

  • better-auth backed by Cloudflare D1 + Drizzle.
  • The auth instance is built per request so it can read the D1 binding via next-on-pages getRequestContext on the Edge runtime; local dev falls back to a libsql file through a DB_TYPE switch.
  • Email/password enabled; Google wired conditionally from env.
  • New client AuthGate (useSession) replaces the client-side PasswordGate.
  • Removes PasswordGate, the unlock store and PasswordSettings, and drops the password branch from /api/config.

Note: the wepush TrendChart redesign that was originally on this branch is already in main, so this PR now contains the flox changes only.

Verification

  • Typecheck: the new/changed files are clean (pre-existing, unrelated flox type errors remain).
  • Biome: changed files pass.
  • Drizzle migration generated for the better-auth tables.

Follow-up (manual, before it works)

  • Create a D1 database, put its id in wrangler.jsonc, and apply the migration (cf:remotedb / cf:localdb).
  • Set BETTER_AUTH_SECRET (and BETTER_AUTH_URL in prod). For Google: GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, and NEXT_PUBLIC_GOOGLE_ENABLED=true.

@vercel

vercelBot commented May 29, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
repo-changelogReadyReadyPreview, CommentMay 29, 2026 10:17am

@cd996
cd996force-pushed the feat/flox-auth-wepush-trendchart branch from b8bd5b4 to 911210bCompareMay 29, 2026 10:13
@cd996cd996 changed the title feat: flox better-auth + wepush TrendChart redesignfeat(flox): add better-auth (email/password + Google), replace PasswordGateMay 29, 2026
…rdGate
Integrate better-auth backed by a Cloudflare D1 + Drizzle adapter. The
auth instance is built per-request so it can read the D1 binding via
next-on-pages getRequestContext on the Edge runtime; local dev falls back
to a libsql file through a DB_TYPE switch. Email/password is enabled and
Google is wired conditionally from env. A client AuthGate (useSession)
replaces the old client-side PasswordGate.
Also removes the obsolete PasswordGate, unlock store and PasswordSettings,
and drops the password branch from the /api/config route.
Sign up for freeto 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

@cd996