Skip to content

Commit 9db637d

Browse files
committed
feat: move "Continue with passkey" button under login button and add ability to set order of this button
1 parent 01894d0 commit 9db637d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@ export default class TwoFactorsAuthPlugin extends AdminForthPlugin {
178178
if ( this.options.passkeys.allowLoginWithPasskeys !== false ) {
179179
this.options.passkeys.allowLoginWithPasskeys = true;
180180
if ( !this.adminforth.config.customization.loginPageInjections ) {
181-
this.adminforth.config.customization.loginPageInjections = { underInputs: [], panelHeader: [] };
181+
this.adminforth.config.customization.loginPageInjections = { underLoginButton: [], panelHeader: [] };
182182
}
183-
this.adminforth.config.customization.loginPageInjections.underInputs.push({ file: this.componentPath('LoginWithPasskeyButton.vue'), meta: {} });
183+
this.adminforth.config.customization.loginPageInjections.underLoginButton.push({ file: this.componentPath('LoginWithPasskeyButton.vue'), meta: { afOrder: this.options.passkeys.continueWithButtonsOrder || 0 } });
184184
}
185185
}
186186
}

types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ export type PluginOptions = {
3636
* Remember user for number of days after login with Passkey, so that user won't be challenged with 2FA on every login.
3737
*/
3838
rememberDaysAfterPasskeyLogin?: number;
39+
40+
/**
41+
* Order of "Continue with passkey" button in under login button injection
42+
*/
43+
continueWithButtonsOrder?: number,
3944
/**
4045
* Period between showing alert suggesting to set up Passkeys if not set up yet.
4146
*/

0 commit comments

Comments
 (0)