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>
This commit is contained in:
Fabian Meumertzheim 2021-03-21 09:44:37 +01:00 committed by GitHub
parent db4683e0d6
commit 44d27333a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)