@aparajita/capacitor-biometric-auth
Advanced tools
Comparing version 5.0.2 to 5.1.0
@@ -88,3 +88,3 @@ import type { PluginListenerHandle, PluginResultError, WebPlugin } from '@capacitor/core'; | ||
* authentication dialog and returns the error code userFallback. If undefined, | ||
* the localized systetm default title is used. Passing an empty string | ||
* the localized system default title is used. Passing an empty string | ||
* hides the fallback button completely. | ||
@@ -139,10 +139,20 @@ * | ||
* True if the device has biometric authentication capability | ||
* and the current user has enrolled in biometry. | ||
* and the current user has enrolled in some form of biometry. | ||
*/ | ||
isAvailable: boolean; | ||
/** | ||
* The type of biometry available on the device. | ||
* The primary type of biometry available on the device. If the device | ||
* supports both fingerprint and face authentication, this will be | ||
* `BiometryType.touchId`. | ||
*/ | ||
biometryType: BiometryType; | ||
/** | ||
* All of the biometry types supported by the device (currently only | ||
* Android devices support multiple biometry types). If no biometry | ||
* is available, this will be an empty array. If multiple types | ||
* are supported, Android only guarantees that one of them is actually | ||
* available. | ||
*/ | ||
biometryTypes: BiometryType[]; | ||
/** | ||
* If biometry is not available and the system gives a reason why, | ||
@@ -149,0 +159,0 @@ * it will be returned here. Otherwise it's an empty string. |
@@ -15,2 +15,3 @@ import { BiometricAuthBase } from './base'; | ||
biometryType: BiometryType.none, | ||
biometryTypes: [], | ||
reason: '', | ||
@@ -17,0 +18,0 @@ code: BiometryErrorType.none, |
@@ -14,2 +14,3 @@ import { BiometricAuthBase } from './base'; | ||
biometryType: this.biometryType, | ||
biometryTypes: [], | ||
reason: '', | ||
@@ -21,7 +22,7 @@ code: BiometryErrorType.none, | ||
return this.checkBiometry().then(({ isAvailable, biometryType }) => { | ||
var _a; | ||
if (isAvailable) { | ||
if ( | ||
// eslint-disable-next-line no-alert | ||
confirm((options === null || options === void 0 ? void 0 : options.reason) || | ||
`Authenticate with ${getBiometryName(biometryType)}?`)) { | ||
confirm((_a = options === null || options === void 0 ? void 0 : options.reason) !== null && _a !== void 0 ? _a : `Authenticate with ${getBiometryName(biometryType)}?`)) { | ||
return; | ||
@@ -28,0 +29,0 @@ } |
@@ -111,2 +111,3 @@ 'use strict'; | ||
biometryType: this.biometryType, | ||
biometryTypes: [], | ||
reason: '', | ||
@@ -118,7 +119,7 @@ code: exports.BiometryErrorType.none, | ||
return this.checkBiometry().then(({ isAvailable, biometryType }) => { | ||
var _a; | ||
if (isAvailable) { | ||
if ( | ||
// eslint-disable-next-line no-alert | ||
confirm((options === null || options === void 0 ? void 0 : options.reason) || | ||
`Authenticate with ${getBiometryName(biometryType)}?`)) { | ||
confirm((_a = options === null || options === void 0 ? void 0 : options.reason) !== null && _a !== void 0 ? _a : `Authenticate with ${getBiometryName(biometryType)}?`)) { | ||
return; | ||
@@ -166,2 +167,3 @@ } | ||
biometryType: exports.BiometryType.none, | ||
biometryTypes: [], | ||
reason: '', | ||
@@ -168,0 +170,0 @@ code: exports.BiometryErrorType.none, |
@@ -109,2 +109,3 @@ var capacitorBiometricAuth = (function (exports, core, app) { | ||
biometryType: this.biometryType, | ||
biometryTypes: [], | ||
reason: '', | ||
@@ -116,7 +117,7 @@ code: exports.BiometryErrorType.none, | ||
return this.checkBiometry().then(({ isAvailable, biometryType }) => { | ||
var _a; | ||
if (isAvailable) { | ||
if ( | ||
// eslint-disable-next-line no-alert | ||
confirm((options === null || options === void 0 ? void 0 : options.reason) || | ||
`Authenticate with ${getBiometryName(biometryType)}?`)) { | ||
confirm((_a = options === null || options === void 0 ? void 0 : options.reason) !== null && _a !== void 0 ? _a : `Authenticate with ${getBiometryName(biometryType)}?`)) { | ||
return; | ||
@@ -164,2 +165,3 @@ } | ||
biometryType: exports.BiometryType.none, | ||
biometryTypes: [], | ||
reason: '', | ||
@@ -166,0 +168,0 @@ code: exports.BiometryErrorType.none, |
{ | ||
"name": "@aparajita/capacitor-biometric-auth", | ||
"version": "5.0.2", | ||
"version": "5.1.0", | ||
"description": "Provides access to the native biometric auth APIs for Capacitor apps", | ||
@@ -56,35 +56,34 @@ "author": "Aparajita Fishman", | ||
"@aparajita/capacitor-docgen-format": "github:aparajita/capacitor-docgen-format", | ||
"@aparajita/eslint-config-base": "^1.1.5", | ||
"@aparajita/prettier-config": "^1.0.0", | ||
"@aparajita/eslint-config-base": "^1.1.6", | ||
"@aparajita/prettier-config": "^2.0.0", | ||
"@aparajita/swiftly": "^1.0.4", | ||
"@capacitor/cli": "^5.0.5", | ||
"@commitlint/cli": "^17.6.5", | ||
"@commitlint/config-conventional": "^17.6.5", | ||
"@capacitor/cli": "^5.4.1", | ||
"@commitlint/cli": "^17.7.2", | ||
"@commitlint/config-conventional": "^17.7.0", | ||
"@ionic/swiftlint-config": "^1.1.2", | ||
"@rollup/plugin-json": "^6.0.0", | ||
"@types/node": "^20.3.1", | ||
"@typescript-eslint/eslint-plugin": "^5.60.0", | ||
"@typescript-eslint/parser": "^5.60.0", | ||
"commit-and-tag-version": "^11.2.2", | ||
"eslint": "^8.43.0", | ||
"eslint-config-prettier": "^8.8.0", | ||
"@types/node": "^20.8.0", | ||
"@typescript-eslint/eslint-plugin": "^6.7.3", | ||
"@typescript-eslint/parser": "^6.7.3", | ||
"commit-and-tag-version": "^11.2.3", | ||
"eslint": "^8.50.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-config-standard": "^17.1.0", | ||
"eslint-import-resolver-typescript": "^3.5.5", | ||
"eslint-plugin-import": "^2.27.5", | ||
"eslint-plugin-n": "^16.0.0", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"eslint-import-resolver-typescript": "^3.6.1", | ||
"eslint-plugin-import": "^2.28.1", | ||
"eslint-plugin-n": "^16.1.0", | ||
"eslint-plugin-promise": "^6.1.1", | ||
"nodemon": "^2.0.22", | ||
"prettier": "^2.8.8", | ||
"prettier-plugin-java": "^2.1.0", | ||
"rimraf": "^5.0.1", | ||
"rollup": "^3.25.1", | ||
"nodemon": "^3.0.1", | ||
"prettier": "^3.0.3", | ||
"prettier-plugin-java": "^2.3.1", | ||
"rimraf": "^5.0.5", | ||
"rollup": "^3.29.4", | ||
"swiftlint": "^1.0.2", | ||
"typescript": "~5.1.3" | ||
"typescript": "~5.2.2" | ||
}, | ||
"dependencies": { | ||
"@capacitor/android": "^5.0.5", | ||
"@capacitor/app": "^5.0.3", | ||
"@capacitor/core": "^5.0.5", | ||
"@capacitor/ios": "^5.0.5" | ||
"@capacitor/android": "^5.4.1", | ||
"@capacitor/app": "^5.0.6", | ||
"@capacitor/core": "^5.4.1", | ||
"@capacitor/ios": "^5.4.1" | ||
}, | ||
@@ -94,5 +93,5 @@ "scripts": { | ||
"lint.eslint": "eslint --fix --cache --ext .js,.cjs,.mjs,.ts --max-warnings 0", | ||
"lint.prettier": "prettier --write --plugin ./node_modules/prettier-plugin-java --cache --list-different", | ||
"lint.prettier": "prettier --write --cache --list-different", | ||
"lint.tsc": "tsc --noEmit", | ||
"lint": "pnpm lint.eslint . && pnpm lint.prettier . && pnpm lint.tsc && swiftly ios", | ||
"lint": "pnpm lint.eslint . && pnpm lint.prettier '**/*.{js,mjs,ts,json,md,java}' && pnpm lint.tsc && swiftly ios", | ||
"prebuilder": "pnpm clean", | ||
@@ -99,0 +98,0 @@ "builder": "tsc ${SOURCE_MAP:-} && rollup -c rollup.config.mjs", |
@@ -140,8 +140,9 @@ <div class="markdown-body"> | ||
| Prop | Type | Description | | ||
| :----------- | :------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| isAvailable | boolean | True if the device has biometric authentication capability and the current user has enrolled in biometry. | | ||
| biometryType | <a href="#biometrytype">BiometryType</a> | The type of biometry available on the device. | | ||
| 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. | | ||
| 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. This allows you to check for specific errors in a platform- independent way, for example:<br><br>if (result.code === <a href="#biometryerrortype">BiometryErrorType.biometryNotEnrolled</a>) { ... } | | ||
| Prop | Type | Description | | ||
| :------------ | :------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| isAvailable | boolean | True if the device has biometric authentication capability and the current user has enrolled in some form of biometry. | | ||
| biometryType | <a href="#biometrytype">BiometryType</a> | The primary type of biometry available on the device. If the device supports both fingerprint and face authentication, this will be <a href="#biometrytype">`BiometryType.touchId`</a>. | | ||
| biometryTypes | BiometryType[] | All of the biometry types supported by the device (currently only Android devices support multiple biometry types). If no biometry is available, this will be an empty array. If multiple types are supported, Android only guarantees that one of them is actually available. | | ||
| 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. | | ||
| 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. This allows you to check for specific errors in a platform- independent way, for example:<br><br>if (result.code === <a href="#biometryerrortype">BiometryErrorType.biometryNotEnrolled</a>) { ... } | | ||
@@ -155,3 +156,3 @@ #### AuthenticateOptions | ||
| allowDeviceCredential | boolean | If true, allows for authentication using device unlock credentials. Default is false.<br><br>iOS: If biometry is available, enrolled, and not disabled, the system uses that first. After the first Touch ID failure or second Face ID failure, if `iosFallbackTitle` is not an empty string, a fallback button appears in the authentication dialog. If the user taps the fallback button, the system prompts the user for the device passcode or the user’s password. If `iosFallbackTitle` is an empty string, no fallback button will appear.<br><br>If biometry is not available, enrolled and enabled, and a passcode is set, the system immediately prompts the user for the device passcode or user’s password. Authentication fails with the error code `passcodeNotSet` if the device passcode isn’t enabled.<br><br>If a passcode is not set on the device, a `passcodeNotSet` error is returned.<br><br>The system disables passcode authentication after 6 unsuccessful attempts, with progressively increasing delays between attempts.<br><br>The title of the fallback button may be customized by setting `iosFallbackTitle` to a non-empty string.<br><br>Android: The user will first be prompted to authenticate with biometrics, but also given the option to authenticate with their device PIN, pattern, or password by tapping a button in the authentication dialog. The title of the button is supplied by the system. | | ||
| iosFallbackTitle | string | The system presents a fallback button when biometric authentication fails — for example, because the system doesn’t recognize the presented finger, or after several failed attempts to recognize the user’s face.<br><br>If `allowDeviceCredential` is false, tapping this button dismisses the authentication dialog and returns the error code userFallback. If undefined, the localized systetm default title is used. Passing an empty string hides the fallback button completely.<br><br>If `allowDeviceCredential` is true and this is undefined, the localized system default title is used. | | ||
| iosFallbackTitle | string | The system presents a fallback button when biometric authentication fails — for example, because the system doesn’t recognize the presented finger, or after several failed attempts to recognize the user’s face.<br><br>If `allowDeviceCredential` is false, tapping this button dismisses the authentication dialog and returns the error code userFallback. If undefined, the localized system default title is used. Passing an empty string hides the fallback button completely.<br><br>If `allowDeviceCredential` is true and this is undefined, the localized system default title is used. | | ||
| androidTitle | string | Title for the Android dialog. If not supplied, the system default is used. | | ||
@@ -158,0 +159,0 @@ | androidSubtitle | string | Subtitle for the Android dialog. If not supplied, the system default is used. | |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
86385
28
782
206
Updated@capacitor/android@^5.4.1
Updated@capacitor/app@^5.0.6
Updated@capacitor/core@^5.4.1
Updated@capacitor/ios@^5.4.1