Skip to content

Auth: Mobile — Login + Register screens (AuthStack) #130

@EricGrill

Description

@EricGrill

Auth System — Mobile Step 1

Replace the hardcoded role-picker with real login/registration screens.

New screens:

  • mobile/screens/auth/LoginScreen.tsx — email/phone + password
  • mobile/screens/auth/RegisterScreen.tsx — invite-based registration
  • mobile/screens/auth/ForgotPasswordScreen.tsx — password reset

Navigation change:

Root Navigator
├── AuthStack (unauthenticated)
│   ├── LoginScreen
│   ├── RegisterScreen
│   └── ForgotPasswordScreen
└── AppStack (authenticated)
    ├── WorkerStack
    ├── ForemanStack
    ├── FarmStack
    └── SupplyStack

Remove: current role-picker in App.tsx, hardcoded user IDs

Auth state on app launch:

  1. Show splash screen
  2. Check SecureStore for refresh token
  3. If found → call /api/auth/refresh → success → AppStack
  4. If missing or failed → AuthStack

Active stack determined by user's highest-privilege role at selected farm (from login response roles array).

i18n: All new screens use existing i18n setup (add keys to en.json/es.json)

Depends on: Backend auth endpoints
Design doc: docs/AUTH.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions