11import AdminForth , { AdminForthDataTypes , logger } from '../../adminforth/index.js' ;
22import type { AdminForthResourceInput , AdminForthResource , AdminUser , AdminForthResourceColumn } from '../../adminforth/index.js' ;
33import { randomUUID } from 'crypto' ;
4- import TwoFactorsAuthPlugin from '../../plugins/adminforth-two-factors-auth/index.js'
54import ForeignInlineListPlugin from '../../plugins/adminforth-foreign-inline-list/index.js' ;
65import UploadPlugin from '../../plugins/adminforth-upload/index.js' ;
76import AdminForthStorageAdapterLocalFilesystem from "../../adapters/adminforth-storage-adapter-local/index.js" ;
@@ -10,6 +9,7 @@ import DashboardPlugin from '../../plugins/adminforth-dashboard/index.js';
109import UserSoftDelete from '../../plugins/adminforth-user-soft-delete/index.js' ;
1110import KeyValueAdapterRam from '../../adapters/adminforth-key-value-adapter-ram/index.js' ;
1211import OAuthPlugin from './configs/oauthPluginConfig.js' ;
12+ import TwoFactorsAuthPlugin from './configs/twoFactorAuthPluginConfig.js' ;
1313import EmailInvitePlugin from '../../plugins/adminforth-email-invite/index.js' ;
1414import EmailPasswordResetPlugin from '../../plugins/adminforth-email-password-reset/index.js' ;
1515
@@ -132,39 +132,7 @@ export default {
132132 } ,
133133 ] ,
134134 plugins : [
135- new TwoFactorsAuthPlugin (
136- {
137- twoFaSecretFieldName : 'secret2fa' ,
138- timeStepWindow : 1 ,
139- stepUpMfaGracePeriodSeconds : 300 ,
140- usersFilterToAllowSkipSetup : ( adminUser : AdminUser ) => {
141- // allow skip setup 2FA for users which email is 'adminforth' or 'adminguest'
142- return ( true ) ;
143- } ,
144- passkeys : {
145- keyValueAdapter : new KeyValueAdapterRam ( ) ,
146- credentialResourceID : "passkeys" ,
147- credentialIdFieldName : "credential_id" ,
148- credentialMetaFieldName : "meta" ,
149- credentialUserIdFieldName : "user_id" ,
150- settings : {
151- expectedOrigin : "http://localhost:3123" ,
152- rp : {
153- name : "New Reality" ,
154- } ,
155- user : {
156- nameField : "email" ,
157- displayNameField : "email" ,
158- } ,
159- authenticatorSelection : {
160- authenticatorAttachment : "both" ,
161- requireResidentKey : true ,
162- userVerification : "required" ,
163- } ,
164- } ,
165- }
166- }
167- ) ,
135+ TwoFactorsAuthPlugin ,
168136 new ForeignInlineListPlugin ( {
169137 foreignResourceId : 'cars_sl'
170138 } ) ,
0 commit comments