Overview
Implement email-only authentication flow for new user registration, allowing users to sign up with just an email address (no phone required).
PR: #212
Branch: feat/email-registration
Status: Ready for review
Feature Description
User Flow
- Client calls
newUserEmailRegistrationInitiate with email address
- Backend creates Kratos identity, sends OTP via recovery flow
- Client calls
newUserEmailRegistrationValidate with flowId + code
- Backend validates code, creates account if new, returns auth token
Key Components
- GraphQL Mutations:
newUserEmailRegistrationInitiate - Start email registration
newUserEmailRegistrationValidate - Complete with OTP code
- Kratos Integration: New schema
email_no_password_v0
- Account Upgrade: Device accounts can upgrade to email accounts
- Schema Upgrade Paths:
- Device → Email (replaces traits)
- Phone → Phone+Email (adds email trait)
Files Changed (43 files, +855/-216)
src/graphql/public/root/mutation/new-user-email-registration-*.ts
src/app/authentication/email.ts
src/services/kratos/auth-email-no-password.ts
src/app/accounts/create-account.ts
src/app/accounts/upgrade-device-account.ts
src/domain/authentication/registration-payload-validator.ts
dev/ory/kratos.yml
Known Issues / Follow-up Work
🔴 HIGH PRIORITY (Security)
🟡 MEDIUM PRIORITY (Tech Debt)
🟢 LOW PRIORITY
Testing Status
Dependencies
- Ory Kratos configuration update required
- No external feature dependencies
Related Issues/PRs
Overview
Implement email-only authentication flow for new user registration, allowing users to sign up with just an email address (no phone required).
PR: #212
Branch:
feat/email-registrationStatus: Ready for review
Feature Description
User Flow
newUserEmailRegistrationInitiatewith email addressnewUserEmailRegistrationValidatewith flowId + codeKey Components
newUserEmailRegistrationInitiate- Start email registrationnewUserEmailRegistrationValidate- Complete with OTP codeemail_no_password_v0Files Changed (43 files, +855/-216)
src/graphql/public/root/mutation/new-user-email-registration-*.tssrc/app/authentication/email.tssrc/services/kratos/auth-email-no-password.tssrc/app/accounts/create-account.tssrc/app/accounts/upgrade-device-account.tssrc/domain/authentication/registration-payload-validator.tsdev/ory/kratos.ymlKnown Issues / Follow-up Work
🔴 HIGH PRIORITY (Security)
Account Enumeration Vulnerability
src/services/kratos/auth-email-no-password.tslines 73-78createIdentityForEmailRegistration()reveals whether email is already registeredMissing TOTP Flow Completion
newUserEmailRegistrationValidatereturnstotpRequiredbut no follow-upRace Condition in Account Creation
new-user-email-registration-validate.tslines 63-78🟡 MEDIUM PRIORITY (Tech Debt)
SchemaIdType.EmailNoPasswordV0enumupgrade-device-account.ts🟢 LOW PRIORITY
Testing Status
yarn tsc --noEmit- 0 errors)Dependencies
Related Issues/PRs