@adminforth/two-factors-auth 2.3.0 → 2.4.0

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/build.log CHANGED
@@ -15,5 +15,5 @@ custom/package.json
15
15
  custom/tsconfig.json
16
16
  custom/utils.js
17
17
 
18
- sent 271,266 bytes received 210 bytes 542,952.00 bytes/sec
18
+ sent 271,255 bytes received 210 bytes 542,930.00 bytes/sec
19
19
  total size is 270,439 speedup is 1.00
package/dist/index.js CHANGED
@@ -166,9 +166,9 @@ export default class TwoFactorsAuthPlugin extends AdminForthPlugin {
166
166
  if (this.options.passkeys.allowLoginWithPasskeys !== false) {
167
167
  this.options.passkeys.allowLoginWithPasskeys = true;
168
168
  if (!this.adminforth.config.customization.loginPageInjections) {
169
- this.adminforth.config.customization.loginPageInjections = { underInputs: [], panelHeader: [] };
169
+ this.adminforth.config.customization.loginPageInjections = { underLoginButton: [], panelHeader: [], underInputs: [] };
170
170
  }
171
- this.adminforth.config.customization.loginPageInjections.underInputs.push({ file: this.componentPath('LoginWithPasskeyButton.vue'), meta: {} });
171
+ this.adminforth.config.customization.loginPageInjections.underLoginButton.push({ file: this.componentPath('LoginWithPasskeyButton.vue'), meta: { afOrder: this.options.passkeys.continueWithButtonsOrder || 0 } });
172
172
  }
173
173
  }
174
174
  }
package/index.ts CHANGED
@@ -178,9 +178,9 @@ export default class TwoFactorsAuthPlugin extends AdminForthPlugin {
178
178
  if ( this.options.passkeys.allowLoginWithPasskeys !== false ) {
179
179
  this.options.passkeys.allowLoginWithPasskeys = true;
180
180
  if ( !this.adminforth.config.customization.loginPageInjections ) {
181
- this.adminforth.config.customization.loginPageInjections = { underInputs: [], panelHeader: [] };
182
- }
183
- this.adminforth.config.customization.loginPageInjections.underInputs.push({ file: this.componentPath('LoginWithPasskeyButton.vue'), meta: {} });
181
+ this.adminforth.config.customization.loginPageInjections = { underLoginButton: [], panelHeader: [], underInputs: [] };
182
+ }
183
+ (this.adminforth.config.customization.loginPageInjections.underLoginButton as Array<any>).push({ file: this.componentPath('LoginWithPasskeyButton.vue'), meta: { afOrder: this.options.passkeys.continueWithButtonsOrder || 0 } });
184
184
  }
185
185
  }
186
186
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/two-factors-auth",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "description": "AdminForth plugin for two factors authentication",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -26,7 +26,7 @@
26
26
  "license": "ISC",
27
27
  "dependencies": {
28
28
  "@simplewebauthn/server": "^13.2.1",
29
- "adminforth": "^2.9.2",
29
+ "adminforth": "^2.4.0-next.221",
30
30
  "node-2fa": "^2.0.3"
31
31
  },
32
32
  "devDependencies": {
package/types.ts CHANGED
@@ -36,6 +36,11 @@ export type PluginOptions = {
36
36
  * Remember user for number of days after login with Passkey, so that user won't be challenged with 2FA on every login.
37
37
  */
38
38
  rememberDaysAfterPasskeyLogin?: number;
39
+
40
+ /**
41
+ * Order of "Continue with passkey" button in under login button injection
42
+ */
43
+ continueWithButtonsOrder?: number,
39
44
  /**
40
45
  * Period between showing alert suggesting to set up Passkeys if not set up yet.
41
46
  */