@aparajita/capacitor-biometric-auth 7.0.0 → 7.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/esm/definitions.d.ts +6 -1
- package/dist/esm/web.js +9 -2
- package/dist/plugin.cjs.js +9 -2
- package/dist/plugin.js +9 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -250,7 +250,7 @@ Register a function that will be called when the app resumes. The function will
|
|
|
250
250
|
| isAvailable | boolean | True if the device supports _at least_ weak biometric authentication and the current user has enrolled in some form of biometry. Note that if `strongBiometryIsAvailable` is true, this will also be true. |
|
|
251
251
|
| strongBiometryIsAvailable | boolean | True if the device has strong biometric authentication capability and the current user has enrolled in that strong biometry.<br><br>On iOS this value and `isAvailable` will always be the same, since iOS only supports strong biometry.<br><br>On Android, for example, if the device supports both fingerprint and face authentication, and the user has enrolled only in face authentication, and Android considers face authentication on that device to be weak, then `isAvailable` will be true but this value will be false. |
|
|
252
252
|
| biometryType | <a href="#biometrytype">BiometryType</a> | The primary (most secure) type of biometry supported by the device. Note that _supported_ is not the same as _available_, which requires the biometry to be enrolled. |
|
|
253
|
-
| biometryTypes | BiometryType[] | All of the biometry types supported by the hardware on the device (currently only Android devices support multiple biometry types). If no biometry is supported, this will be an empty array.<br><br>Note that _supported_ is not the same as _available_, which requires the biometry to be enrolled.
|
|
253
|
+
| biometryTypes | BiometryType[] | All of the biometry types supported by the hardware on the device (currently only Android devices support multiple biometry types). If no biometry is supported, i.e. `biometryType === <a href="#biometrytype">BiometryType.none`</a>, this will be an empty array.<br><br>Note that _supported_ is not the same as _available_, which requires the biometry to be enrolled. |
|
|
254
254
|
| deviceIsSecure | boolean | Returns true if the device is secure. On iOS, this means that the device has a passcode set. On Android, this means that the device has a PIN, pattern, or password set. |
|
|
255
255
|
| reason | string | If biometry is not available and the system gives a reason why, it will be returned here. Otherwise it's an empty string. |
|
|
256
256
|
| code | <a href="#biometryerrortype">BiometryErrorType</a> | If biometry is not available, the error code will be returned here. Otherwise it's an empty string. The error code will be one of the <a href="#biometryerrortype">`BiometryErrorType`</a> enum values, and is consistent across platforms. |
|
|
@@ -324,7 +324,7 @@ This method mutates the array and returns a reference to the same array. |
|
|
|
324
324
|
| androidTitle | string | Title for the Android dialog. If not supplied, the system default is used. |
|
|
325
325
|
| androidSubtitle | string | Subtitle for the Android dialog. If not supplied, the system default is used. |
|
|
326
326
|
| androidConfirmationRequired | boolean | Determines if successful weak biometric authentication must be confirmed.<br><br>For information on this setting, see https://developer.android.com/reference/android/hardware/biometrics/BiometricPrompt.Builder#setConfirmationRequired(boolean).<br><br>Default: `true` |
|
|
327
|
-
| androidBiometryStrength | <a href="#androidbiometrystrength">AndroidBiometryStrength</a> | Set the strength of Android biometric authentication that will be accepted.<br><br>Default: <a href="#androidbiometrystrength">`AndroidBiometryStrength.weak`</a>
|
|
327
|
+
| androidBiometryStrength | <a href="#androidbiometrystrength">AndroidBiometryStrength</a> | Set the strength of Android biometric authentication that will be accepted.<br><br>👉 **NOTE:** On Android 9 & 10 (API 28-29), this will effectively always be `.weak` if `allowDeviceCredential` is true. This is a known limitation of the Android API. 🤯<br><br>Default: <a href="#androidbiometrystrength">`AndroidBiometryStrength.weak`</a> |
|
|
328
328
|
|
|
329
329
|
#### PluginListenerHandle
|
|
330
330
|
|
|
@@ -127,6 +127,10 @@ export interface AuthenticateOptions {
|
|
|
127
127
|
/**
|
|
128
128
|
* Set the strength of Android biometric authentication that will be accepted.
|
|
129
129
|
*
|
|
130
|
+
* 👉 **NOTE:** On Android 9 & 10 (API 28-29), this will effectively always
|
|
131
|
+
* be `.weak` if `allowDeviceCredential` is true. This is a known limitation
|
|
132
|
+
* of the Android API. 🤯
|
|
133
|
+
*
|
|
130
134
|
* Default: `AndroidBiometryStrength.weak`
|
|
131
135
|
*/
|
|
132
136
|
androidBiometryStrength?: AndroidBiometryStrength;
|
|
@@ -192,7 +196,8 @@ export interface CheckBiometryResult {
|
|
|
192
196
|
/**
|
|
193
197
|
* All of the biometry types supported by the hardware on the device
|
|
194
198
|
* (currently only Android devices support multiple biometry types).
|
|
195
|
-
* If no biometry is supported,
|
|
199
|
+
* If no biometry is supported, i.e. `biometryType === BiometryType.none`,
|
|
200
|
+
* this will be an empty array.
|
|
196
201
|
*
|
|
197
202
|
* Note that _supported_ is not the same as _available_, which requires
|
|
198
203
|
* the biometry to be enrolled.
|
package/dist/esm/web.js
CHANGED
|
@@ -94,7 +94,9 @@ export class BiometricAuthWeb extends BiometricAuthBase {
|
|
|
94
94
|
}
|
|
95
95
|
if (isBiometryTypes(types)) {
|
|
96
96
|
this.biometryType = types[0];
|
|
97
|
-
this.
|
|
97
|
+
if (this.biometryType !== BiometryType.none) {
|
|
98
|
+
this.biometryTypes = types;
|
|
99
|
+
}
|
|
98
100
|
}
|
|
99
101
|
else {
|
|
100
102
|
for (let i = 0; i < types.length; i++) {
|
|
@@ -103,7 +105,12 @@ export class BiometricAuthWeb extends BiometricAuthBase {
|
|
|
103
105
|
const biometryType =
|
|
104
106
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
105
107
|
BiometryType[types[i]];
|
|
106
|
-
this.
|
|
108
|
+
if (this.biometryType === BiometryType.none) {
|
|
109
|
+
this.biometryTypes = [];
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
this.biometryTypes.push(biometryType);
|
|
113
|
+
}
|
|
107
114
|
if (i === 0) {
|
|
108
115
|
this.biometryType = biometryType;
|
|
109
116
|
}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -222,7 +222,9 @@ class BiometricAuthWeb extends BiometricAuthBase {
|
|
|
222
222
|
}
|
|
223
223
|
if (isBiometryTypes(types)) {
|
|
224
224
|
this.biometryType = types[0];
|
|
225
|
-
this.
|
|
225
|
+
if (this.biometryType !== exports.BiometryType.none) {
|
|
226
|
+
this.biometryTypes = types;
|
|
227
|
+
}
|
|
226
228
|
}
|
|
227
229
|
else {
|
|
228
230
|
for (let i = 0; i < types.length; i++) {
|
|
@@ -231,7 +233,12 @@ class BiometricAuthWeb extends BiometricAuthBase {
|
|
|
231
233
|
const biometryType =
|
|
232
234
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
233
235
|
exports.BiometryType[types[i]];
|
|
234
|
-
this.
|
|
236
|
+
if (this.biometryType === exports.BiometryType.none) {
|
|
237
|
+
this.biometryTypes = [];
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
this.biometryTypes.push(biometryType);
|
|
241
|
+
}
|
|
235
242
|
if (i === 0) {
|
|
236
243
|
this.biometryType = biometryType;
|
|
237
244
|
}
|
package/dist/plugin.js
CHANGED
|
@@ -220,7 +220,9 @@ var capacitorBiometricAuth = (function (exports, core, app) {
|
|
|
220
220
|
}
|
|
221
221
|
if (isBiometryTypes(types)) {
|
|
222
222
|
this.biometryType = types[0];
|
|
223
|
-
this.
|
|
223
|
+
if (this.biometryType !== exports.BiometryType.none) {
|
|
224
|
+
this.biometryTypes = types;
|
|
225
|
+
}
|
|
224
226
|
}
|
|
225
227
|
else {
|
|
226
228
|
for (let i = 0; i < types.length; i++) {
|
|
@@ -229,7 +231,12 @@ var capacitorBiometricAuth = (function (exports, core, app) {
|
|
|
229
231
|
const biometryType =
|
|
230
232
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
231
233
|
exports.BiometryType[types[i]];
|
|
232
|
-
this.
|
|
234
|
+
if (this.biometryType === exports.BiometryType.none) {
|
|
235
|
+
this.biometryTypes = [];
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
this.biometryTypes.push(biometryType);
|
|
239
|
+
}
|
|
233
240
|
if (i === 0) {
|
|
234
241
|
this.biometryType = biometryType;
|
|
235
242
|
}
|
package/package.json
CHANGED