Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

05 — Screen Inventory (Auth Module)

Every screen of the Auth module, its intent, route, composition, states, permissions, platform behavior and events. Authoritative components in 00-shared/03; this file enumerates which ones each screen uses with module specifics.


Legend

States = idle / loading / success / empty / error(offline, rate, invalid) / disabled / permission. Analytics events follow {module}.{screen}.{action} (proposed; SDK open — 00-shared/10 §8).


1. Login Screen (/login)

FieldDetail
PurposeAuthenticate with email/password → token pair
Entrycold app, any deep link, session expiry, "log out" piggyback
Exitsuccess → /home; → /forgot-password; → /register; → /login/2fa (planned)
InputsAppTextField email (autofill username), AppTextField password (obscure, autofill current-password)
Primary CTALogin filled button (fullWidth)
Secondary"Forgot password?" (text), "Register your school" (text)
Statesloading (button), error (inline field/server), rate-limited (429 countdown), offline (banner+native retry), locked (specific copy)
Analyticsauth.login.submit, auth.login.success, auth.login.failure(code)
Keyboardemail → .emailAddress; password → .visiblePassword-ish + onSubmit
Adaptivephone single pane; tablet/desktop centered card ≤ 480 dp with brand mark
a11ylabels linked, error live-region, focus first invalid
Motionm-fast focus; error shake; success → swap to home m-base slide

2. 2FA Challenge Screen (/login/2fa) (planned)

FieldDetail
PurposeSecond factor check after password (server-dependent — blocked OQ-1)
Entryfrom login challenge signal
Exitsuccess → /home; failure → same screen with inline TOTP error
Inputone 6-digit TOTP field (auto-advance)
Primary CTAVerify
Statesloading, invalid code (401 → clear + focus), rate-limited; "remember device" toggle (client prefs only, no server flag)
a11ysingle semantics label "6-digit verification code"; keyboard number
NoteServer returns no challenge today: feature is forward-looking; keep route dormant

3. Register Screen (/register)

FieldDetail
PurposeCreate org admin + tenant in one step (server assigns org_admin)
Entry/login "register", fresh install
Exitsuccess → token stored → /home (+ "verify your email" banner)
InputsfirstName, lastName, email, password (min8), confirm (client-only), tenantId, phone optional
Auto-fillgiven-name, family-name, email, new-password, tel
Primary CTACreate account
Secondary"Back to login"
Statesas login; plus 409 duplicate (email) inline
Deep noteRegistration returns tokens immediately → user is authenticated; duplicate email → ConflictException 409 (auth.service.ts:57)
Contentinformational "what happens next" list (verify email, 2FA prompt)

4. Verify Email (/verify-email) + result

FieldDetail
PurposeConsume verification token from email link/banner
Entrydeep link /login/?token=; auto-fires; banner direct-entry
Exitsuccess → /home (or /login); error → form with "resend"
Inputimplicit token (hidden)
Primary CTAVerify email (auto-submit on prefilled token); Resend email
Statesverifying (spinner), success check, error invalid/expired, resend throttled (5/120s)
Adaptivecentered card; scroll when keyboard
a11ysuccess announced via live region

5. Forgot Password (/forgot-password)

FieldDetail
PurposeRequest one-time reset email (never reveals existence)
InputAppTextField email
Primary CTA"Send reset link"
Statessuccess screen-as-message identical for existing/missing (privacy auth.service.ts:259-282); rate (3/min)
Notedesign should play "email sent" neutrally

6. Reset Password (/reset-password)

FieldDetail
PurposeSet new password with 1 h token; revokes all sessions
Inputpassword (min8), confirm
Primary CTA"Set new password"
Statessuccess → login redirect; token expired/invalid 400 (inline + "request new link")
Security notesession-array cleared server-side (auth.service.ts:306); login requires manual re-setup of any clients

7. Tenant Registration Result (/verify-email covers most) — same as 3/4


8. Security Hub (/settings/security) — authenticated

Table rows (AppListTile): Two-factor authentication (status switch, badge on/off), Devices & sessions (count badge), API keys (count badge). Master-detail on tablets.

9. Sessions / Devices Screen (/settings/security/devices)

FieldDetail
PurposeList current user's active sessions
Route/settings/security/devices (list) + sheet for detail
SourceGET /auth/sessions → array of documents (deviceName, browser, operatingSystem, platform, ipAddress, location, expiresAt, lastActivityAt)
WidgetsListTile group (current device labeled "You"), per-item icon inherits platform
Pull-to-refreshRefreshIndicator
Empty"No other devices"
Row actionsAppMenu → "Log out this device" (DELETE /auth/sessions/:id) with confirm dialog
CTAbottom button "Log out all devices" (POST /auth/logout-all)

10. API Keys — List (/settings/security/api-keys)

FieldDetail
SourceGET /auth/api-keys
WidgetsAppCard per key: prefix…, scopes chips, createdAt / lastUsedAt, menu (revoke)
FABFAB "New key" (one per screen)

11. API Keys — Create (bottom sheet)

FieldDetail
Purposetwo-step: form → one-time secret reveal
Formname (required), scopes chips (optional, free-text input chip)
Revealfull raw key + Copy + "I've saved it" (server never re-serves)
SourcePOST /auth/api-keys returns {id, prefix, key} — key shown once

12. API Keys — Revoke dialog

Confirm + DELETE /auth/api-keys/:id → snackbar; item leaves list (optimistic, rollback on fail).

13. Security Settings — 2FA detail (/settings/security/2fa)

FieldDetail
Status tileTOTP on/off (badge)
Enable flowPOST /auth/2fa/enable → QR + secret, copy; input 6-digit → POST /auth/2fa/verify → set ON (server sets enabled only after this)
Disable flowinput current code → POST /auth/2fa/disable
Statessecret visible once?; turn-off needs typed code

14. Lock Screen (/lock) (forward-looking)

  • App-level: biometric/Whisper unlock of locally-stored session; style consistent with settings.read-gated surfaces; no server API.

Shared components used

AppTextField, AppButton, AppSnackbar, AppCard, AppListTile, AppBottomSheet, AppDialog, AppMenu, AppSkeleton, AppEmptyState, AppOfflineBanner, AppFAB, AppChips, AppBadge, AppAvatar. Module-specific: 2FA code field, secret reveal card, session tile — defined in 07_Component_Library.md.

Analytics events (proposed)

auth.login.{submit,success,failure}, auth.register.{submit,success,duplicate}, auth.verify.{success,invalid}, auth.reset.{sent,completed,expired}, auth.2fa.{enabled,disabled,verify_failed}, auth.session.{list,revoke,logout_all}, auth.apikey.{create,reveal,revoke} (all proposed).

Keyboard, landscape, tablet, desktop

  • Pre-auth: portrait-first; landscape uses scroll; tablet/desktop constrain width.
  • Sessions/api-keys on tablet: two-column list/detail; desktop hover row highlights.
  • All fields keyboard-avoidance + ScrollView resizeToAvoidBottomInset.