@aparajita/capacitor-biometric-auth 7.0.0 → 7.0.1

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 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. |
@@ -192,7 +192,8 @@ export interface CheckBiometryResult {
192
192
  /**
193
193
  * All of the biometry types supported by the hardware on the device
194
194
  * (currently only Android devices support multiple biometry types).
195
- * If no biometry is supported, this will be an empty array.
195
+ * If no biometry is supported, i.e. `biometryType === BiometryType.none`,
196
+ * this will be an empty array.
196
197
  *
197
198
  * Note that _supported_ is not the same as _available_, which requires
198
199
  * 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.biometryTypes = types;
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.biometryTypes.push(biometryType);
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
  }
@@ -222,7 +222,9 @@ class BiometricAuthWeb extends BiometricAuthBase {
222
222
  }
223
223
  if (isBiometryTypes(types)) {
224
224
  this.biometryType = types[0];
225
- this.biometryTypes = types;
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.biometryTypes.push(biometryType);
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.biometryTypes = types;
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.biometryTypes.push(biometryType);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aparajita/capacitor-biometric-auth",
3
- "version": "7.0.0",
3
+ "version": "7.0.1",
4
4
  "description": "Provides access to the native biometric auth & device security APIs for Capacitor apps",
5
5
  "author": "Aparajita Fishman",
6
6
  "license": "MIT",