fix(biometric) Incorrect error reported on Android with no device passcode set and fallback allowed (#2648)

* Fix incorrect error being reported in certain cases with fallback allowed

* Add change file

* Rework original solution due to overlooking authenticators logic on API >= `Build.VERSION_CODES.R`

* fix(biometric): don't cast the Android error message to String

* fix(biometric): report a missing device credential before showing the Android prompt

Replaces the override of ERROR_NO_BIOMETRICS in the prompt callback, which keyed on
the caller's flag rather than the device state and missed the no-hardware errors.

* fix(biometric): load the missing device credential message from a string resource

* chore(biometric): drop stray semicolon

* docs(biometric): mention the passcodeNotSet error code rename in the change file

* test(e2e): cover the biometric passcodeNotSet rejection on Android

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
This commit is contained in:
Patrick F.andLucas Nogueira authored and GitHub committed 2026-10-11 21:56:38 -03:00
1 parent 2ebe54abce
commit dff0dd4b23
6 files changed
+102 -34

No files matched your search

@@ -0,0 +1,6 @@
---
"biometric": patch:bug
"biometric-js": patch:bug
---
Fix biometric plugin reporting an inconsistent and incorrect error on Android when no device passcode was set and `allowDeviceCredential` is enabled. Android now rejects with the `passcodeNotSet` error code like iOS does; it previously used the undocumented `noDeviceCredential` code, so code matching that string must switch to `passcodeNotSet`.