@@ -293,9 +293,9 @@ To do it, first, create frontend custom component which wraps and intercepts cli
293293< / template >
294294
295295< script setup lang = " ts" >
296- import { use2faApi } from ' @/custom/plugins/TwoFactorsAuthPlugin/use2faApi.ts' ;
296+ import { useTwoFactorsAuth } from ' @/custom/plugins/TwoFactorsAuthPlugin/use2faApi.ts' ;
297297
298- const { get2FaConfirmationResult } = use2faApi ();
298+ const { get2FaConfirmationResult } = useTwoFactorsAuth ();
299299 const emit = defineEmits <{ (e : ' callAction' , payload ? : any ): void }>();
300300 const props = defineProps <{ disabled? : boolean ; meta? : Record <string , any > }>();
301301
@@ -389,9 +389,9 @@ Frontend (Save Interceptor component injected via pageInjections):
389389` ` ` vue title = ' /custom/SaveInterceptor.vue'
390390< script setup >
391391import { useAdminforth } from ' @/adminforth' ;
392- import { use2faApi } from ' @/custom/plugins/TwoFactorsAuthPlugin/use2faApi.ts' ;
392+ import { useTwoFactorsAuth } from ' @/custom/plugins/TwoFactorsAuthPlugin/use2faApi.ts' ;
393393
394- const { get2FaConfirmationResult } = use2faApi ();
394+ const { get2FaConfirmationResult } = useTwoFactorsAuth ();
395395const { registerSaveInterceptor } = useAdminforth ();
396396
397397registerSaveInterceptor (async ({ action , values , resource }) => {
@@ -494,9 +494,9 @@ Imagine you have some button which does some API call
494494
495495< script setup lang = " ts" >
496496import { callApi } from ' @/utils' ;
497- import { use2faApi } from ' @/custom/plugins/TwoFactorsAuthPlugin/use2faApi.ts' ;
497+ import { useTwoFactorsAuth } from ' @/custom/plugins/TwoFactorsAuthPlugin/use2faApi.ts' ;
498498
499- const { get2FaConfirmationResult } = use2faApi ();
499+ const { get2FaConfirmationResult } = useTwoFactorsAuth ();
500500
501501async function callAdminAPI() {
502502 const verificationResult = await get2FaConfirmationResult ();
@@ -538,9 +538,9 @@ You might want to protect this call with a second factor also. To do it, we need
538538< script setup lang = " ts" >
539539import { callApi } from ' @/utils' ;
540540import { useAdminforth } from ' @/adminforth' ;
541- import { use2faApi } from ' @/custom/plugins/TwoFactorsAuthPlugin/use2faApi.ts' ;
541+ import { useTwoFactorsAuth } from ' @/custom/plugins/TwoFactorsAuthPlugin/use2faApi.ts' ;
542542
543- const { get2FaConfirmationResult } = use2faApi ();
543+ const { get2FaConfirmationResult } = useTwoFactorsAuth ();
544544const { alert } = useAdminforth ();
545545
546546async function callAdminAPI() {
0 commit comments