feat: handle existing customer email during signup (BA-67)#353
Draft
cursor[bot] wants to merge 7 commits intomainfrom
Draft
feat: handle existing customer email during signup (BA-67)#353cursor[bot] wants to merge 7 commits intomainfrom
cursor[bot] wants to merge 7 commits intomainfrom
Conversation
- Add ToS acceptance tracking to StoredUser and WizardSession - Create EmailCaptureScreen for collecting user email - Create ToSScreen with Stripe CLI-style ToS acceptance - Add email capture and ToS steps to wizard flow (gated by --signup flag) - Update direct signup to persist ToS acceptance timestamp - Add TERMS_OF_SERVICE_URL and PRIVACY_POLICY_URL constants - Add store methods for email capture and ToS acceptance with back-navigation support - Update router test mock to include new reset methods - Fix revert callbacks to return false when screens weren't shown (signup=false) The --signup flow now requires: 1. Email capture (pre-filled from --signup-email if provided) 2. Explicit ToS acceptance before proceeding to authentication Agent mode auto-approves both steps when --signup flag is used.
- Add EmailCapture and ToS screens to wizard flow diagram - Update back-navigation table with new screen Esc behavior - Add BDD scenarios for signup flow with ToS acceptance - Document email pre-filling from --signup-email flag - Document ToS decline behavior (routes to cancel outro)
- Implement 'the wizard launches with {string}' step to handle flags
- Add email capture step definitions (enter email, check screen)
- Add ToS step definitions (accept/decline, screen checks)
- Add email pre-fill validation step
- All 99 BDD scenarios now passing
- Update auth task to wait for tosAccepted when --signup is used - Add EmailCapture and ToS screens to JourneyStepper Auth step - Ensures browser only opens after user completes email + ToS flow - Fixes journey stepper showing incorrect completion states Fixes issue where browser opened prematurely during signup flow
- Update EmailCaptureScreen to collect both email and full name - Add two-step flow: email first, then full name - Add setSignupFullName() store method with analytics - Fixes 401 auth error by ensuring direct signup has all required fields - Direct signup now works correctly, avoiding OAuth fallback
- Extend DirectSignupResult to include error code for user detection - Update EmailCaptureScreen to detect 'user_already_exists' error - Show options to log in or retry with different email - Add switchToLogin() method to WizardStore - Add analytics tracking for existing user scenario - Add BDD test scenarios for existing customer flow - Use resolveZone() instead of direct session.region access Closes BA-67
Contributor
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Results will be posted here when complete. |
- Add signupTokensObtained flag to session to track early token acquisition - Update bin.ts to skip duplicate signup attempt when tokens already obtained - Add markSignupTokensObtained() method to WizardStore - Clear TextInput after email/name submission using key prop - Use resolveZone() with readDisk: false for zone resolution in screen
5 tasks
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
This PR adds functionality to detect when a user attempts to sign up with an email that already belongs to an existing Amplitude customer, and offers them options to either log in with the existing account or provide a different email address.
Changes
Core Logic
DirectSignupResulttype to include optionalcodefield for error identificationperformDirectSignupto return the error code when the API provides itEmailCaptureScreento attempt direct signup during email/name capture to detect existing users earlyUI/UX
EmailCaptureScreenwith three options:switchToLogin()method toWizardStorefor clean flow transitionAnalytics
'existing user detected during signup'event with zone and error code'signup switched to login'event when user chooses to log inTesting
Technical Details
The implementation calls
performDirectSignupimmediately after the user enters their full name. This approach:bin.tsThe error code
'user_already_exists'is expected from the provisioning endpoint when an email is already registered. This is the same pattern used by the Stripe CLI for detecting existing accounts.Closes
BA-67
Slack Thread