Repository navigation
Ask for device authentication before sensitive confirm actions - #365
subhannaeem wants to merge 10 commits into
Conversation
| } | ||
|
|
||
| return try { | ||
| runCancellableCatching { authMethod.authenticateUser() }.flatten() |
There was a problem hiding this comment.
minor: Why catch around authenticateUser() here instead of making BiometricPromptAuthenticationMethod return a failure when there is no activity, as its Result type promises?
There was a problem hiding this comment.
@mikyar
The method now returns failures directly and reuses the checked activity, so the service catch and extra executor are gone.
| biometricsService.performOneTimeAuthentication() | ||
| .onSuccess { | ||
| context.deliverApproved() | ||
| router.back() | ||
| } | ||
| .onFailure { showPresentationError(AuthenticationFailedPresentationError(it)) } |
There was a problem hiding this comment.
minor: Can we have one helper for this gate and its AuthenticationFailedPresentationError mapping? Same block in PaymentRequestViewModel, TransactionSignViewModel, PairRequestViewModel, SendEnterAmountViewModel and both backup ViewModels.
There was a problem hiding this comment.
@mikyar
Added onAuthenticated to BaseViewModel to handle success and errors. All seven gates now use it, including both backup ViewModels.
|
Needs UX confirmation from @SabitKadyr |
Closes #339
Testing
proof-pr365-device-auth.mp4
pairing-auth-success-annotated.mp4
./gradlew :tools:biometrics:impl:testNightlyUnitTest)