Add email sign-in (magic link)

Đang mở
#28 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
38/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
authentication, backend

Hướng nghiên cứu

Start with auth.ts to see the single Google provider and how provisionUser() is called, then read lib/auth/providers.ts and components/login-form.tsx. The work also touches lib/email/send.ts, lib/ratelimit.ts, and a new migration for the single-use token table. Done means a magic-link sign-in works end to end, tokens are single-use and expire, sends are rate-limited per email and per IP, and the plan/interval params survive the new path.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

backend enhancement frontend help wanted

Copied from DeadantCo/answerLoops#18 · originally opened by sethr07 on 2026-11-20

Copied from https://github.com/answerLoops/answerLoops/issues/30 — originally opened by @NathanTarbert on 2026-08-20

What

Add email sign-in as a second login option alongside Google. Magic link (passwordless) rather than email+password.

Why

auth.ts configures exactly one OAuth provider — Google. There's no password field anywhere in the schema. Anyone without (or unwilling to use) a Google account can't sign in at all right now.

Magic link over password: no password hashing, reset-flow, or breach/strength-check surface to build or maintain — keeps the app's current no-password posture instead of adding a new attack surface (credential stuffing) it doesn't have today.

Scope

There's no Auth.js Adapter configured — JWT session strategy, a custom users table, no accounts/sessions/verificationTokens tables. So this is a custom flow, not NextAuth's built-in Email provider (which expects an Adapter). Concretely:

  • New migration: single-use token table (email, hashed token, expiry, used-at)
  • Magic-link email template in lib/email/send.ts, reusing the existing Resend integration
  • A Credentials provider in auth.ts that verifies the token and calls the same provisionUser() the Google path already uses
  • Rate limiting on send via the existing lib/ratelimit.ts — per-email and per-IP, since email-bombing is the abuse case
  • Build on configuredSignInProviders in lib/auth/providers.ts instead of adding a second entry point in components/login-form.tsx; the page and sign-in action already read that list
  • Must carry plan/interval query params through the new entry point the same way /login does for the Google path — a new sign-in path is another place that bug can reappear

Effort

S-M — roughly 1-2 days for one engineer. No adapter migration, no password infrastructure; the pieces being reused (Resend, rate limiting, provisionUser) already exist.

Related: #370 (closed; sign-in provider list shipped in #371), and the email and password issue #457.

Start here: new to the project? Read CONTRIBUTING.md first. It covers the ground rules, running answerLoops locally, and how to open a pull request.

Ngôn ngữ chính
TypeScript
Star
0
Fork
0
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của DeadantCo/answerLoopsdev

Tất cả issue của DeadantCo/answerLoopsdev

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.