@aparajita/capacitor-biometric-auth 2.0.4 β†’ 2.0.7

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
@@ -6,6 +6,8 @@ This plugin for [Capacitor 3](https://capacitorjs.com) provides access to native
6
6
 
7
7
  πŸ‘‰ **NOTE:** This plugin only works with Capacitor 3. If you are upgrading from the Capacitor 2 version, note that the plugin name has changed to `BiometricAuth`.
8
8
 
9
+ πŸ›‘ **IMPORTANT:** If you are upgrading from a version prior to 2.0.5, please note that `androidMaxAttempts` in [`AuthenticateOptions`](#authenticateoptions) is now the maximum consecutive failed attempts that are allowed, vs. the previous behavior which was maximum consecutive failed attempts + 1 (which was a bug). So if `androidMaxAttempts` is set to 3, [`authenticate`](#authenticate) will return `BiometryErrorType.authenticationFailed`as soon as the third consecutive attempt fails.
10
+
9
11
  ## Demos
10
12
 
11
13
  Here is `capacitor-biometric-auth` running on the [demo app](https://github.com/aparajita/capacitor-biometric-auth-demo) on both iOS and Android.
@@ -155,7 +157,7 @@ Register a function that will be called when the app resumes. The function will
155
157
  |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. |
156
158
  |androidTitle|string| Title for the Android dialog. If not supplied, the system default is used. |
157
159
  |androidSubtitle|string| Subtitle for the Android dialog. If not supplied, the system default is used. |
158
- |androidMaxAttempts|number| The maximum number of failed biometric verification attempts before returning `BiometryError.authenticationFailed`. The default is 3. |
160
+ |androidMaxAttempts|number| When this many consecutive biometric verification attempts fail, `authenticate` returns `BiometryErrorType.authenticationFailed`. The default is 3. |
159
161
 
160
162
 
161
163
  #### PluginListenerHandle
@@ -110,12 +110,12 @@ public class AuthActivity extends AppCompatActivity {
110
110
 
111
111
  // When allowDeviceCredential is true, I can't seem to force the prompt
112
112
  // to go away, so skip attempt counting.
113
- if (!allowDeviceCredential && attemptCount > maxAttempts) {
113
+ if (!allowDeviceCredential && attemptCount >= maxAttempts) {
114
114
  finishActivity(
115
115
  BiometryResultType.FAILURE,
116
116
  0,
117
117
  String.format(
118
- "The user exceeded the maximum of %d attempt(s)",
118
+ "The user reached the maximum of %d attempt(s)",
119
119
  maxAttempts
120
120
  )
121
121
  );
@@ -102,8 +102,9 @@ export interface AuthenticateOptions {
102
102
  */
103
103
  androidSubtitle?: string;
104
104
  /**
105
- * The maximum number of failed biometric verification attempts before
106
- * returning `BiometryError.authenticationFailed`. The default is 3.
105
+ * When this many consecutive biometric verification attempts fail,
106
+ * `authenticate` returns `BiometryErrorType.authenticationFailed`.
107
+ * The default is 3.
107
108
  */
108
109
  androidMaxAttempts?: number;
109
110
  }
package/dist/esm/index.js CHANGED
@@ -7,7 +7,6 @@ console.log(`loaded ${name}`);
7
7
  // we have one version of the TS code to rule them all, and there
8
8
  // is no need to lazy load. 😁
9
9
  const plugin = new BiometricAuth();
10
- // eslint-disable-next-line @typescript-eslint/naming-convention
11
10
  const biometricAuth = registerPlugin(kPluginName, {
12
11
  web: plugin,
13
12
  ios: plugin,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aparajita/capacitor-biometric-auth",
3
- "version": "2.0.3",
3
+ "version": "2.0.7",
4
4
  "description": "Provides access to the native biometric auth APIs for Capacitor apps",
5
5
  "author": "Aparajita Fishman",
6
6
  "license": "MIT",
@@ -21,14 +21,16 @@
21
21
  ],
22
22
  "scripts": {
23
23
  "clean": "rimraf ./dist",
24
- "build": "pnpm check && pnpm build.only",
25
- "build.dev": "pnpm check && pnpm build.only.dev",
26
- "build.only": "pnpm clean && tsc $SOURCE_MAP && pnpm rollup && make-ios-plugin && pnpm docgen",
27
- "build.only.dev": "SOURCE_MAP=--sourceMap pnpm build.only",
24
+ "build": "pnpm check.fix && pnpm builder",
25
+ "build.dev": "pnpm check.fix && pnpm builder.dev",
26
+ "builder": "pnpm clean && tsc $SOURCE_MAP && pnpm rollup && make-ios-plugin && pnpm docgen",
27
+ "builder.dev": "SOURCE_MAP=--sourceMap pnpm builder",
28
28
  "rollup": "rollup -c rollup.config.mjs",
29
- "watch": "nodemon -w ./src -w tsconfig.json -w rollup.config.mjs --exec 'pnpm build --silent' -e ts",
30
- "lint": "eslint . && pnpm typecheck",
31
- "lint.fix": "eslint --fix . && pnpm typecheck",
29
+ "watcher": "nodemon -w ./src -w tsconfig.json -w rollup.config.mjs --exec 'pnpm $BUILD --silent' -e ts",
30
+ "watch": "BUILD=build pnpm watcher",
31
+ "watch.dev": "BUILD=build.dev pnpm watcher",
32
+ "lint": "eslint --cache . && pnpm typecheck",
33
+ "lint.fix": "eslint --cache --fix . && pnpm typecheck",
32
34
  "typecheck": "tsc --noEmit",
33
35
  "lint.swift": "pnpm swiftlint",
34
36
  "prettier": "prettier --check \"**/*.{css,html,ts,js,json,java}\"",
@@ -43,8 +45,9 @@
43
45
  "verify:android": "cd android && ./gradlew clean build test && cd ..",
44
46
  "verify:web": "pnpm build",
45
47
  "push": "git push --follow-tags origin main",
46
- "release.check": "commit-and-tag-version ${VERSION:+-r $VERSION} --dry-run",
47
- "release": "commit-and-tag-version ${VERSION:+-r $VERSION} && pnpm push && pnpm publish"
48
+ "release.check": "pnpm check.fix && commit-and-tag-version ${VERSION:+-r $VERSION} --dry-run",
49
+ "release.prepare": "commit-and-tag-version ${VERSION:+-r $VERSION} && pnpm builder",
50
+ "release": "pnpm push && pnpm publish"
48
51
  },
49
52
  "keywords": [
50
53
  "capacitor",
@@ -75,34 +78,35 @@
75
78
  "devDependencies": {
76
79
  "@aparajita/capacitor-docgen": "github:aparajita/capacitor-docgen",
77
80
  "@aparajita/capacitor-docgen-format": "github:aparajita/capacitor-docgen-format",
78
- "@aparajita/eslint-config-base": "^1.1.2",
81
+ "@aparajita/eslint-config-base": "^1.1.4",
79
82
  "@aparajita/prettier-config": "^1.0.0",
80
- "@aparajita/swiftly": "^1.0.1",
83
+ "@aparajita/swiftly": "^1.0.4",
81
84
  "@capacitor/core": "^3.6.0",
82
85
  "@ionic/swiftlint-config": "^1.1.2",
83
86
  "@rollup/plugin-json": "^4.1.0",
84
- "@types/node": "^18.0.1",
85
- "@typescript-eslint/eslint-plugin": "^5.30.4",
86
- "@typescript-eslint/parser": "^5.30.4",
87
+ "@types/node": "^18.0.6",
88
+ "@typescript-eslint/eslint-plugin": "^5.30.7",
89
+ "@typescript-eslint/parser": "^5.30.7",
87
90
  "chalk": "^5.0.1",
88
91
  "commit-and-tag-version": "^10.0.1",
89
- "eslint": "^8.19.0",
92
+ "eslint": "^8.20.0",
90
93
  "eslint-config-prettier": "^8.5.0",
91
94
  "eslint-config-standard": "^17.0.0",
92
- "eslint-import-resolver-typescript": "^3.2.0",
95
+ "eslint-import-resolver-typescript": "^3.2.7",
93
96
  "eslint-plugin-import": "^2.26.0",
94
- "eslint-plugin-n": "^15.2.3",
97
+ "eslint-plugin-n": "^15.2.4",
95
98
  "eslint-plugin-prettier": "^4.2.1",
96
99
  "eslint-plugin-promise": "^6.0.0",
97
- "nodemon": "^2.0.18",
100
+ "nodemon": "^2.0.19",
98
101
  "prettier": "^2.7.1",
99
102
  "prettier-plugin-java": "^1.6.2",
100
103
  "rimraf": "^3.0.2",
101
- "rollup": "^2.75.7",
104
+ "rollup": "^2.77.0",
105
+ "swiftlint": "^1.0.1",
102
106
  "typescript": "~4.7.4"
103
107
  },
104
108
  "dependencies": {
105
- "@aparajita/capacitor-native-decorator": "^2.0.4",
109
+ "@aparajita/capacitor-native-decorator": "^2.0.7",
106
110
  "@capacitor/android": "^3.6.0",
107
111
  "@capacitor/app": "^1.1.1",
108
112
  "@capacitor/ios": "^3.6.0"
@@ -159,7 +159,6 @@ console.log(`loaded ${name}`);
159
159
  // we have one version of the TS code to rule them all, and there
160
160
  // is no need to lazy load. 😁
161
161
  const plugin = new BiometricAuth();
162
- // eslint-disable-next-line @typescript-eslint/naming-convention
163
162
  const biometricAuth = core.registerPlugin(kPluginName, {
164
163
  web: plugin,
165
164
  ios: plugin,
package/dist/plugin.js CHANGED
@@ -154,7 +154,6 @@ var capacitorBiometricAuth = (function (exports, core, capacitorNativeDecorator,
154
154
  // we have one version of the TS code to rule them all, and there
155
155
  // is no need to lazy load. 😁
156
156
  const plugin = new BiometricAuth();
157
- // eslint-disable-next-line @typescript-eslint/naming-convention
158
157
  const biometricAuth = core.registerPlugin(kPluginName, {
159
158
  web: plugin,
160
159
  ios: plugin,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aparajita/capacitor-biometric-auth",
3
- "version": "2.0.4",
3
+ "version": "2.0.7",
4
4
  "description": "Provides access to the native biometric auth APIs for Capacitor apps",
5
5
  "author": "Aparajita Fishman",
6
6
  "license": "MIT",
@@ -48,34 +48,35 @@
48
48
  "devDependencies": {
49
49
  "@aparajita/capacitor-docgen": "github:aparajita/capacitor-docgen",
50
50
  "@aparajita/capacitor-docgen-format": "github:aparajita/capacitor-docgen-format",
51
- "@aparajita/eslint-config-base": "^1.1.2",
51
+ "@aparajita/eslint-config-base": "^1.1.4",
52
52
  "@aparajita/prettier-config": "^1.0.0",
53
- "@aparajita/swiftly": "^1.0.1",
53
+ "@aparajita/swiftly": "^1.0.4",
54
54
  "@capacitor/core": "^3.6.0",
55
55
  "@ionic/swiftlint-config": "^1.1.2",
56
56
  "@rollup/plugin-json": "^4.1.0",
57
- "@types/node": "^18.0.1",
58
- "@typescript-eslint/eslint-plugin": "^5.30.5",
59
- "@typescript-eslint/parser": "^5.30.5",
57
+ "@types/node": "^18.0.6",
58
+ "@typescript-eslint/eslint-plugin": "^5.30.7",
59
+ "@typescript-eslint/parser": "^5.30.7",
60
60
  "chalk": "^5.0.1",
61
61
  "commit-and-tag-version": "^10.0.1",
62
- "eslint": "^8.19.0",
62
+ "eslint": "^8.20.0",
63
63
  "eslint-config-prettier": "^8.5.0",
64
64
  "eslint-config-standard": "^17.0.0",
65
- "eslint-import-resolver-typescript": "^3.2.1",
65
+ "eslint-import-resolver-typescript": "^3.2.7",
66
66
  "eslint-plugin-import": "^2.26.0",
67
67
  "eslint-plugin-n": "^15.2.4",
68
68
  "eslint-plugin-prettier": "^4.2.1",
69
69
  "eslint-plugin-promise": "^6.0.0",
70
- "nodemon": "^2.0.18",
70
+ "nodemon": "^2.0.19",
71
71
  "prettier": "^2.7.1",
72
72
  "prettier-plugin-java": "^1.6.2",
73
73
  "rimraf": "^3.0.2",
74
- "rollup": "^2.75.7",
74
+ "rollup": "^2.77.0",
75
+ "swiftlint": "^1.0.1",
75
76
  "typescript": "~4.7.4"
76
77
  },
77
78
  "dependencies": {
78
- "@aparajita/capacitor-native-decorator": "^2.0.4",
79
+ "@aparajita/capacitor-native-decorator": "^2.0.7",
79
80
  "@capacitor/android": "^3.6.0",
80
81
  "@capacitor/app": "^1.1.1",
81
82
  "@capacitor/ios": "^3.6.0"
@@ -85,14 +86,16 @@
85
86
  },
86
87
  "scripts": {
87
88
  "clean": "rimraf ./dist",
88
- "build": "pnpm check && pnpm build.only",
89
- "build.dev": "pnpm check && pnpm build.only.dev",
90
- "build.only": "pnpm clean && tsc $SOURCE_MAP && pnpm rollup && make-ios-plugin && pnpm docgen",
91
- "build.only.dev": "SOURCE_MAP=--sourceMap pnpm build.only",
89
+ "build": "pnpm check.fix && pnpm builder",
90
+ "build.dev": "pnpm check.fix && pnpm builder.dev",
91
+ "builder": "pnpm clean && tsc $SOURCE_MAP && pnpm rollup && make-ios-plugin && pnpm docgen",
92
+ "builder.dev": "SOURCE_MAP=--sourceMap pnpm builder",
92
93
  "rollup": "rollup -c rollup.config.mjs",
93
- "watch": "nodemon -w ./src -w tsconfig.json -w rollup.config.mjs --exec 'pnpm build --silent' -e ts",
94
- "lint": "eslint . && pnpm typecheck",
95
- "lint.fix": "eslint --fix . && pnpm typecheck",
94
+ "watcher": "nodemon -w ./src -w tsconfig.json -w rollup.config.mjs --exec 'pnpm $BUILD --silent' -e ts",
95
+ "watch": "BUILD=build pnpm watcher",
96
+ "watch.dev": "BUILD=build.dev pnpm watcher",
97
+ "lint": "eslint --cache . && pnpm typecheck",
98
+ "lint.fix": "eslint --cache --fix . && pnpm typecheck",
96
99
  "typecheck": "tsc --noEmit",
97
100
  "lint.swift": "pnpm swiftlint",
98
101
  "prettier": "prettier --check \"**/*.{css,html,ts,js,json,java}\"",
@@ -107,7 +110,8 @@
107
110
  "verify:android": "cd android && ./gradlew clean build test && cd ..",
108
111
  "verify:web": "pnpm build",
109
112
  "push": "git push --follow-tags origin main",
110
- "release.check": "commit-and-tag-version ${VERSION:+-r $VERSION} --dry-run",
111
- "release": "commit-and-tag-version ${VERSION:+-r $VERSION} && pnpm push && pnpm publish"
113
+ "release.check": "pnpm check.fix && commit-and-tag-version ${VERSION:+-r $VERSION} --dry-run",
114
+ "release.prepare": "commit-and-tag-version ${VERSION:+-r $VERSION} && pnpm builder",
115
+ "release": "pnpm push && pnpm publish"
112
116
  }
113
117
  }