fix(login): register with email only in the bundled view#105
Merged
Conversation
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.
What
The bundled registration screen (
AuthRoutes->Loginin register mode) now collects only an email. It previously required a phone number too.Why
Registration only needs an email. I confirmed against the API:
RegistrationRequestSchemaisemail: z.email()withphone: z.string().nullish(), and the controller treats an empty or missing phone as "not provided". So the phone field in the bundled view asked for data the flow does not need, and made email-only sign-up impossible throughAuthRoutes. Phone can be added and verified later through the existing phone flow.Changes
src/views/Login.tsx: remove the phone input from register mode, along with thephone/phoneErrorstate and thephoneInputimport.canSubmitfor registration is now just a valid email, andregister()no longer passes a phone. Login mode is untouched (its identifier still accepts an email or a phone, soisValidPhoneNumberstays).src/client/createSeamlessAuthClient.ts:RegisterInput.phoneis now optional (phone?: string | null) and only sent when provided, mirroringbootstrapToken. This is a widening, so existing callers passing a phone still compile, and headless consumers can still submit one.Tests
The register test is rewritten to submit with an email only. It asserts there is no phone field rendered, and that
registeris called without aphoneproperty. The unusedphoneInputtest mock is removed.Full suite: 223 passed.
Out of scope, flagging
npm run format:checkreports two files that are already unformatted onmainand unrelated to this change:.changeset/dts-relative-paths.mdandtsconfig.build.json. They appear to have merged without passing the formatter (same class as the earlier OAuthCallback formatting drift). Not touched here to keep this diff focused. Worth a one-lineprettier --writefollow-up.Checks
npm run typecheck,npm run lintcleannpm run format:checkclean for the files this PR touches