From 979753d8a7cd16f50790994321aa39569988a432 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Fri, 13 Dec 2024 18:12:54 +0100 Subject: [PATCH] Mobile: Fixes #10926: Locked out of mobile app due to broken fingerprint scanner --- .../components/biometrics/biometricAuthenticate.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/app-mobile/components/biometrics/biometricAuthenticate.ts b/packages/app-mobile/components/biometrics/biometricAuthenticate.ts index c8139f5e8..bbc356466 100644 --- a/packages/app-mobile/components/biometrics/biometricAuthenticate.ts +++ b/packages/app-mobile/components/biometrics/biometricAuthenticate.ts @@ -12,9 +12,19 @@ export default async () => { } catch (error) { const errorName = (error as Errors).name; - let errorMessage = error.message; + const errorMessage = error.message; if (errorName === 'FingerprintScannerNotEnrolled' || errorName === 'FingerprintScannerNotAvailable') { - errorMessage = _('Biometric unlock is not setup on the device. Please set it up in order to unlock Joplin. If the device is on lockout, consider switching it off and on to reset biometrics scanning.'); + // In that case we skip the check because the device biometric unlock has been disabled + // by the user. It should be safe to skip the check since in order to disable it, they + // must have full access to the phone, and should have to enter their pin. Not skipping + // the check would be a problem if biometric unlock was disabled as a result of being + // broken. In this case, the user will never be able to unlock Joplin. + // Ref: https://github.com/laurent22/joplin/issues/10926 + + logger.warn('Biometric unlock is not setup on the device - skipping check'); + return; + + // errorMessage = _('Biometric unlock is not setup on the device. Please set it up in order to unlock Joplin. If the device is on lockout, consider switching it off and on to reset biometrics scanning.'); } error.message = _('Could not verify your identity: %s', errorMessage);