Skip to content

Add emailOTP plugin for passwordless DJ login#241

Open
jakebromberg wants to merge 2 commits intomainfrom
feature/email-otp-backend
Open

Add emailOTP plugin for passwordless DJ login#241
jakebromberg wants to merge 2 commits intomainfrom
feature/email-otp-backend

Conversation

@jakebromberg
Copy link
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
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