Overview
After initial biometric login, the app never prompts for re-authentication — even for sensitive operations like changing payment method, viewing full card number, exporting data, or changing account email. If a user leaves their device unattended while the app is open, anyone with physical access can perform these sensitive operations without the owner's knowledge.
Specifications
Features:
- Sensitive operations require re-authentication if last biometric challenge > 5 minutes ago
requireReauth HOC/hook wrapping sensitive operation handlers
- Last auth timestamp stored in
deviceStore
- Configurable threshold (default 5 minutes, minimum 1 minute)
Tasks:
- Add
lastBiometricAuth: number | null to deviceStore
- Create
useRequireReauth(threshold?: number) hook
- Hook checks
Date.now() - lastBiometricAuth > threshold; if true, triggers biometric prompt
- Wrap payment method change, email change, data export, and admin actions
- Add unit test for within-threshold and past-threshold scenarios
Impacted Files:
src/store/slices/deviceStore.ts
src/hooks/useRequireReauth.ts (create)
- Payment and account settings components
Acceptance Criteria
- Payment method change requires biometric challenge if > 5 minutes since last auth
- Challenge within 5-minute window skipped (smooth UX)
- Biometric cancel blocks the sensitive operation
- Unit tests cover within-threshold, past-threshold, and cancel scenarios
Overview
After initial biometric login, the app never prompts for re-authentication — even for sensitive operations like changing payment method, viewing full card number, exporting data, or changing account email. If a user leaves their device unattended while the app is open, anyone with physical access can perform these sensitive operations without the owner's knowledge.
Specifications
Features:
requireReauthHOC/hook wrapping sensitive operation handlersdeviceStoreTasks:
lastBiometricAuth: number | nulltodeviceStoreuseRequireReauth(threshold?: number)hookDate.now() - lastBiometricAuth > threshold; if true, triggers biometric promptImpacted Files:
src/store/slices/deviceStore.tssrc/hooks/useRequireReauth.ts(create)Acceptance Criteria