File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
plugins/biometric/ios/Sources Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " biometric " : patch:bug
3
+ " biometric-js " : patch:bug
4
+ ---
5
+
6
+ Fix biometric plugin ignoring fallback logic when biometry status is unavailable or not enrolled on iOS.
Original file line number Diff line number Diff line change @@ -98,23 +98,24 @@ class BiometricPlugin: Plugin {
98
98
}
99
99
100
100
@objc func authenticate( _ invoke: Invoke ) throws {
101
- guard self . status. available else {
101
+ let args = try invoke. parseArgs ( AuthOptions . self)
102
+
103
+ let allowDeviceCredential = args. allowDeviceCredential ?? false
104
+
105
+ guard self . status. available || allowDeviceCredential else {
106
+ // Biometry unavailable, fallback disabled
102
107
invoke. reject (
103
108
self . status. errorReason ?? " " ,
104
109
code: self . status. errorCode ?? " "
105
110
)
106
111
return
107
112
}
108
113
109
- let args = try invoke. parseArgs ( AuthOptions . self)
110
-
111
114
let context = LAContext ( )
112
115
context. localizedFallbackTitle = args. fallbackTitle
113
116
context. localizedCancelTitle = args. cancelTitle
114
117
context. touchIDAuthenticationAllowableReuseDuration = 0
115
118
116
- let allowDeviceCredential = args. allowDeviceCredential ?? false
117
-
118
119
// force system default fallback title if an empty string is provided (the OS hides the fallback button in this case)
119
120
if allowDeviceCredential,
120
121
let fallbackTitle = context. localizedFallbackTitle,
You can’t perform that action at this time.
0 commit comments