Skip to content

feat(ATL-75): Add Better Auth for email authentication#77

Open
bolty-from-atl-bitlab[bot] wants to merge 1 commit intomainfrom
bolty/atl-75-better-auth
Open

feat(ATL-75): Add Better Auth for email authentication#77
bolty-from-atl-bitlab[bot] wants to merge 1 commit intomainfrom
bolty/atl-75-better-auth

Conversation

@bolty-from-atl-bitlab
Copy link
Contributor

Summary

Adds email-based authentication using Better Auth alongside existing Nostr authentication.

Changes

Server

  • src/lib/auth.ts - Better Auth configuration with Prisma adapter
  • src/app/api/auth/[...all]/route.ts - API route handler

Client

  • src/lib/auth-client.ts - React client for Better Auth
  • src/app/auth/page.tsx - Updated auth landing with email option
  • src/app/auth/email/page.tsx - Email sign in page
  • src/app/auth/signup/page.tsx - Account creation page

Database

  • Added Session, Account, Verification models for Better Auth
  • Extended User model with email, name, emailVerified, image fields

Other

  • Updated Button component to accept type prop for form submissions
  • Updated .env.sample with Better Auth config

Setup Required

After merging:

  1. Add BETTER_AUTH_SECRET and BETTER_AUTH_URL to environment
  2. Run npx prisma migrate dev to create new tables

Notes

  • Nostr authentication is preserved as an alternative option
  • Email verification is disabled by default (enable when email sending is configured)
  • Account linking is enabled so users can connect email to existing Nostr accounts

Closes ATL-75

- Install better-auth package
- Add auth.ts server configuration with Prisma adapter
- Add auth-client.ts for React client
- Add Better Auth API route handler
- Add Session, Account, Verification models to Prisma schema
- Extend User model with email, name, emailVerified, image fields
- Create email login page (/auth/email)
- Create signup page (/auth/signup)
- Update auth landing page with email option
- Add type prop to Button component for form submissions
- Update .env.sample with Better Auth config

Nostr authentication remains intact as an alternative option.

Closes ATL-75
@vercel
Copy link

vercel bot commented Feb 12, 2026

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

Project Deployment Actions Updated (UTC)
twelvecash Error Error Feb 12, 2026 0:47am

Request Review

@bolty-from-atl-bitlab
Copy link
Contributor Author

⚠️ Vercel Build Note

The preview deployment is failing because new environment variables need to be added to Vercel:

BETTER_AUTH_SECRET="$(openssl rand -base64 32)"
BETTER_AUTH_URL="https://twelve.cash"  # or preview URL

These are required by Better Auth. Once added to Vercel project settings, the build should pass.

(The existing env vars like DATABASE_URL, CF_TOKEN, etc. should already be configured.)

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