arch-atlas

Register + OTP Screens

onboarding_register/presentation/pages

presentation

Overview

Two-step wizard pages: RegisterStepPage collects email + password and triggers registerNotifier; OtpStepPage receives the email via route extra and verifies the 6-digit code, after which the session is finally persisted.

User Flow

  1. RegisterStepPage → registerNotifier.register(email, password).
  2. On success, wizard pushes OtpStepPage with state.extra = {email}.
  3. OtpStepPage submits the code → AuthApiService.verify → AuthStorageService.saveSessionOtp persists the token.
  4. GoRouter redirect bounces to /onboarding_register (or /onboarding_register_seller for pending sellers).

Cases & Edge Cases

  • Hot-reload of OtpStepPage with no route extra crashes — defensive cast is intentional, dev-only failure.
  • Re-sending the OTP is rate-limited server-side; UI cools down the button for ~30s without consulting the backend.
  • If the user backgrounds the app between register and OTP, the partially-saved pendingRegistrationData (in AuthStorageService) keeps the wizard resumable.

Code References

  • lib/src/features/shared/onboarding_register/presentation/pages/register_step_page.dart
  • lib/src/features/shared/onboarding_register/presentation/pages/otp_step_page.dart
  • lib/src/features/shared/onboarding_register/presentation/onboarding_register_wizard.dart

API Calls

Empty — fill this in later. Open the manifest and add content here.

Notes

The /register and /otp routes both point into the onboarding-register wizard rather than the legacy auth/register/register.dart screen, which is kept around but unrouted.