summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorFabian Meumertzheim <fabian@meumertzhe.im>2021-03-21 09:44:37 +0100
committerGitHub <noreply@github.com>2021-03-21 08:44:37 +0000
commit44d27333a741d04ccc2093ff77c8008a80ba9911 (patch)
tree7a2c9753332443e5bb0872d80589a7380472b61a /app/src/main/java
parentdb4683e0d60a31d87c41050445c00b0e48b77ae1 (diff)
Do not cancel keygen biometric prompt on failure (#1357)
Biometric authentication may very well fail a few times due to e.g. using the wrong finger, but that should not cancel the key generation flow. The BiometricAuthenticator UI gracefully handles the error case for us with an informative message. Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/dev/msfjarvis/aps/ui/sshkeygen/SshKeyGenActivity.kt5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/src/main/java/dev/msfjarvis/aps/ui/sshkeygen/SshKeyGenActivity.kt b/app/src/main/java/dev/msfjarvis/aps/ui/sshkeygen/SshKeyGenActivity.kt
index c2025538..ae420813 100644
--- a/app/src/main/java/dev/msfjarvis/aps/ui/sshkeygen/SshKeyGenActivity.kt
+++ b/app/src/main/java/dev/msfjarvis/aps/ui/sshkeygen/SshKeyGenActivity.kt
@@ -109,7 +109,10 @@ class SshKeyGenActivity : AppCompatActivity() {
BiometricAuthenticator.authenticate(
this@SshKeyGenActivity,
R.string.biometric_prompt_title_ssh_keygen
- ) { cont.resume(it) }
+ ) {
+ // Do not cancel on failed attempts as these are handled by the authenticator UI.
+ if (it !is BiometricAuthenticator.Result.Failure) cont.resume(it)
+ }
}
}
if (result !is BiometricAuthenticator.Result.Success)