@adminforth/two-factors-auth 2.3.0 → 2.5.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
19
- total size is 270,439 speedup is 1.00
18
+ sent 271,319 bytes received 210 bytes 543,058.00 bytes/sec
19
+ total size is 270,492 speedup is 1.00
@@ -13,7 +13,7 @@
13
13
  <!-- Modal content -->
14
14
  <div class="relative bg-white rounded-lg shadow dark:bg-gray-700 dark:shadow-black text-gray-500" :class="codeError ? 'rounded-b-none' : ''">
15
15
  <div class="p-8 w-full max-w-md max-h-full custom-auth-wrapper" >
16
- <div v-if="confirmationMode === 'code'">
16
+ <div v-if="confirmationMode === 'code'" class="af-totp-confirmation">
17
17
  <div id="mfaCode-label" class="mx-4">{{$t('Please enter your authenticator code')}} </div>
18
18
  <div class="mt-4 w-full flex flex-col gap-4 justify-center" ref="otpRoot">
19
19
  <v-otp-input
@@ -40,7 +40,7 @@
40
40
  </div>
41
41
  </div>
42
42
  </div>
43
- <div v-else class="flex flex-col items-center justify-center py-4 gap-6">
43
+ <div v-else class="af-passkey-confirmation flex flex-col items-center justify-center py-4 gap-6">
44
44
  <IconShieldOutline class="w-16 h-16 text-lightPrimary dark:text-darkPrimary"/>
45
45
  <p class="text-4xl font-semibold mb-4">Passkey</p>
46
46
  <p class="mb-2 max-w-[300px]">When you are ready, authenticate using the button below</p>
@@ -13,7 +13,7 @@
13
13
  <!-- Modal content -->
14
14
  <div class="relative bg-white rounded-lg shadow dark:bg-gray-700 dark:shadow-black text-gray-500" :class="codeError ? 'rounded-b-none' : ''">
15
15
  <div class="p-8 w-full max-w-md max-h-full custom-auth-wrapper" >
16
- <div v-if="confirmationMode === 'code'">
16
+ <div v-if="confirmationMode === 'code'" class="af-totp-confirmation">
17
17
  <div id="mfaCode-label" class="mx-4">{{$t('Please enter your authenticator code')}} </div>
18
18
  <div class="mt-4 w-full flex flex-col gap-4 justify-center" ref="otpRoot">
19
19
  <v-otp-input
@@ -40,7 +40,7 @@
40
40
  </div>
41
41
  </div>
42
42
  </div>
43
- <div v-else class="flex flex-col items-center justify-center py-4 gap-6">
43
+ <div v-else class="af-passkey-confirmation flex flex-col items-center justify-center py-4 gap-6">
44
44
  <IconShieldOutline class="w-16 h-16 text-lightPrimary dark:text-darkPrimary"/>
45
45
  <p class="text-4xl font-semibold mb-4">Passkey</p>
46
46
  <p class="mb-2 max-w-[300px]">When you are ready, authenticate using the button below</p>
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.5.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
  */