summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2023-05-13 15:24:48 +0530
committerGitHub <noreply@github.com>2023-05-13 15:24:48 +0530
commit29ca93854a57a97bf08122f2523f9114c5052a97 (patch)
treec75da628afa06ade936205d75436089326d7b95f /app
parent789efc46a333736b6e4dc3c4bf89ea242fcfc41e (diff)
fix: check feature flag before biometric auth
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/app/passwordstore/ui/autofill/AutofillDecryptActivity.kt2
-rw-r--r--app/src/main/java/app/passwordstore/ui/crypto/DecryptActivity.kt4
2 files changed, 3 insertions, 3 deletions
diff --git a/app/src/main/java/app/passwordstore/ui/autofill/AutofillDecryptActivity.kt b/app/src/main/java/app/passwordstore/ui/autofill/AutofillDecryptActivity.kt
index 8dccacc3..536e11a9 100644
--- a/app/src/main/java/app/passwordstore/ui/autofill/AutofillDecryptActivity.kt
+++ b/app/src/main/java/app/passwordstore/ui/autofill/AutofillDecryptActivity.kt
@@ -72,7 +72,7 @@ class AutofillDecryptActivity : BasePgpActivity() {
requireKeysExist {
val gpgIdentifiers = getGpgIdentifiers("") ?: return@requireKeysExist
if (
- BiometricAuthenticator.canAuthenticate(this) && features.isEnabled(EnableGPGPassphraseCache)
+ features.isEnabled(EnableGPGPassphraseCache) && BiometricAuthenticator.canAuthenticate(this)
) {
BiometricAuthenticator.authenticate(this) { authResult ->
if (authResult is BiometricAuthenticator.Result.Success) {
diff --git a/app/src/main/java/app/passwordstore/ui/crypto/DecryptActivity.kt b/app/src/main/java/app/passwordstore/ui/crypto/DecryptActivity.kt
index 07bad2e4..4de3c120 100644
--- a/app/src/main/java/app/passwordstore/ui/crypto/DecryptActivity.kt
+++ b/app/src/main/java/app/passwordstore/ui/crypto/DecryptActivity.kt
@@ -69,8 +69,8 @@ class DecryptActivity : BasePgpActivity() {
}
}
if (
- BiometricAuthenticator.canAuthenticate(this@DecryptActivity) &&
- features.isEnabled(EnableGPGPassphraseCache)
+ features.isEnabled(EnableGPGPassphraseCache) &&
+ BiometricAuthenticator.canAuthenticate(this@DecryptActivity)
) {
BiometricAuthenticator.authenticate(this@DecryptActivity) { authResult ->
requireKeysExist { decrypt(isError = false, authResult) }