Skip to content

feat(auth): ship magic link as a real production sign-in method (LAC-3800) - #66

Open
lacymorrow wants to merge 1 commit into
mainfrom
lac-3800/magic-link-production
Open

lacymorrow wants to merge 1 commit into
mainfrom
lac-3800/magic-link-production

Conversation

@lacymorrow

Copy link
Copy Markdown
Contributor

Summary

Paperclip issue: LAC-3800 (mirrors the premium shipkit change; keeps downstreams from re-inheriting the dev-only guard)

  • Remove the NODE_ENV !== "production" term from AUTH_RESEND_ENABLED: downstreams with RESEND_API_KEY set got a working magic link in dev and a sign-in page with no way in once deployed (Keepsake hit this 2026-09-08, keepsake@a322834).
  • AUTH_RESEND_ENABLED now requires RESEND_API_KEY + RESEND_FROM_EMAIL (a sender on a Resend-verified domain); off with DISABLE_AUTH_RESEND.
  • Provider gating aligned with the flag (was AUTH_RESEND_KEY) and sends from RESEND_FROM_EMAIL instead of siteConfig.email.support.
  • New AUTH_ALLOWED_EMAILS allowlist (comma-separated addresses/domains) enforced in the Auth.js signIn callback. Auth.js runs signIn before sendVerificationRequest, so unknown addresses get AccessDenied and no email is ever sent.
  • .env.example + env schema document the new vars.

Rate limiting is premium-shipkit-only (bones has no Upstash dependency); the allowlist is dependency-free.

Testing

  • pnpm vitest run tests/unit/magic-link-allowlist.test.ts: 6 passed
  • tsc --noEmit: clean
  • Biome: clean on changed files (pre-existing issues on untouched lines left alone)

🤖 Generated with Claude Code

…3800)

Remove the NODE_ENV guard that disabled the Resend provider in production
builds; downstreams inheriting it got a working magic link in dev and a
sign-in page with no way in once deployed.

- AUTH_RESEND_ENABLED now requires RESEND_API_KEY + RESEND_FROM_EMAIL
  (a sender on a Resend-verified domain) and works in production
- Provider gating aligned with the flag (was AUTH_RESEND_KEY) and sends
  from RESEND_FROM_EMAIL instead of siteConfig.email.support
- New AUTH_ALLOWED_EMAILS allowlist enforced in the Auth.js signIn
  callback, which runs before sendVerificationRequest, so unknown
  addresses get AccessDenied and no email is ever sent

Mirrors the same change in premium shipkit (lacymorrow/shipkit).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
bones Ready Ready Preview Sep 8, 2026 11:59pm UTC

Request Review

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