File tree Expand file tree Collapse file tree
plugins/biometric/ios/Sources Expand file tree Collapse file tree 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 {
9898 }
9999
100100 @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
102107 invoke. reject (
103108 self . status. errorReason ?? " " ,
104109 code: self . status. errorCode ?? " "
105110 )
106111 return
107112 }
108113
109- let args = try invoke. parseArgs ( AuthOptions . self)
110-
111114 let context = LAContext ( )
112115 context. localizedFallbackTitle = args. fallbackTitle
113116 context. localizedCancelTitle = args. cancelTitle
114117 context. touchIDAuthenticationAllowableReuseDuration = 0
115118
116- let allowDeviceCredential = args. allowDeviceCredential ?? false
117-
118119 // force system default fallback title if an empty string is provided (the OS hides the fallback button in this case)
119120 if allowDeviceCredential,
120121 let fallbackTitle = context. localizedFallbackTitle,
You can’t perform that action at this time.
0 commit comments