Skip to content

[Enhancement] Add biometric re-authentication timeout for sensitive operations #663

Description

@RUKAYAT-CODER

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or requestsecuritySecurity vulnerability or concern

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions