Add email OTP as default login method#288
Merged
jakebromberg merged 4 commits intomainfrom Apr 15, 2026
Merged
Conversation
Deploying wxyc-dj with
|
| Latest commit: |
ea506c3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e4e5859e.dj-site.pages.dev |
| Branch Preview URL: | https://feature-email-otp-frontend.dj-site.pages.dev |
d813931 to
cf73dbf
Compare
JacksonMeade
approved these changes
Apr 5, 2026
Collaborator
JacksonMeade
left a comment
There was a problem hiding this comment.
I like what this does, and I went and tried it out on the preview site. It looks good. My only hope is we could ALSO add username-based OTP in a future PR, because emails are somewhat cumbersome to type. Much better imo to type "jake" and then get your OTP automatically.
DJs share a single computer and log in/out between sets. Email OTP lets them enter their email, get a 6-digit code on their phone, and sign in — no password to remember.
- Add emailOTPClient plugin to both client and server auth clients
- Replace AuthStage "login" with "otp-email" | "otp-verify" | "password" stages
- Add useOTPRequest and useOTPVerify hooks following existing auth hook patterns
- Add EmailOTPForm (email entry), OTPCodeForm (6-digit code entry), and LoginFormSwitcher (orchestrates form switching based on auth stage)
- Update LoginPage to render LoginFormSwitcher instead of static UserPasswordForm
- Add bidirectional navigation: "Sign in with password instead" / "Sign in with email code instead"
- Remove password fields from NewUserForm (onboarding no longer requires password setup)
- Guard temp password check in useNewUser behind if (params.password) so OTP users skip it
- Add setRequiredCredentials reducer for clean credential replacement in onboarding
- Update LoginSlotSwitcher verified alert to remove temporary password reference
- Update all setAuthStage("login") references to "otp-email"
- Add tests for all new components (33 tests across 5 files)
Restore the password and confirm-password fields in NewUserForm. Password setup during onboarding is still required even with OTP as the default login method. - Restore password and confirmPassword RequiredBox fields in NewUserForm - Restore original useNewUser temp password guard (check unconditionally) - Revert addRequiredCredentials back to append behavior - Remove unused setRequiredCredentials reducer - Restore original NewUserForm tests (11 tests including password validation)
The login page now defaults to the email OTP form instead of the username/password form. All E2E auth setup and test helpers need to click "Sign in with password instead" before filling in credentials. This updates the LoginPage page object model with OTP form locators and a switchToPasswordLogin() method, and makes login() and clickForgotPassword() auto-switch when the password form isn't visible. Also updates dashboard and RBAC redirect checks to detect the OTP email input.
8987622 to
080541f
Compare
…jection over HTTP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Depends on WXYC/Backend-Service#241 being deployed first.
Closes #287
Test plan
npx tsc --noEmitpasses (AuthStage type change catches any missed"login"references)/login— OTP email form is the default