Skip to content

Add emailOTP plugin for passwordless DJ login#241

Merged
jakebromberg merged 3 commits intomainfrom
feature/email-otp-backend
Apr 1, 2026
Merged

Add emailOTP plugin for passwordless DJ login#241
jakebromberg merged 3 commits intomainfrom
feature/email-otp-backend

Conversation

@jakebromberg
Copy link
Copy Markdown
Member

Summary

  • Add better-auth emailOTP plugin to auth definition with sign-up disabled, 5 allowed attempts, 5-minute expiry, and hashed OTP storage in production
  • Add WXYC-branded OTP email template with large monospace code display sharing the existing dark/pink theme
  • Add unit tests for OTP email template rendering and SES integration (9 tests)

Closes #240

Test plan

  • npm run typecheck passes
  • npm run lint passes (0 errors)
  • New email-otp unit tests pass (9/9)
  • Start auth service locally, confirm POST /auth/email-otp/send-verification-otp with { "email": "...", "type": "sign-in" } returns { "success": true } and email is sent
  • Confirm GET /auth/email-otp/get-verification-otp?email=...&type=sign-in returns the OTP in non-production

DJs share a single computer in the control room and log in/out between sets. Email OTP lets them sign in by entering their email and a 6-digit code from their phone, eliminating forgotten passwords and mid-shift resets.

- Add better-auth emailOTP plugin to auth definition with sign-up disabled, 5 allowed attempts, 5-minute expiry, and hashed OTP storage in production
- Add WXYC-branded OTP email template with large monospace code display, sharing the same dark/pink theme as existing emails
- Add sendOTPEmail function mapping OTP types (sign-in, email-verification, forget-password) to appropriate subjects and intro text
- Add unit tests for OTP email template rendering and SES integration
@jakebromberg jakebromberg force-pushed the feature/email-otp-backend branch from 2775fcc to 7c15f2d Compare April 1, 2026 21:35
@jakebromberg jakebromberg merged commit 9cadf14 into main Apr 1, 2026
4 checks passed
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.

Add emailOTP plugin for passwordless DJ login

1 participant