From 0db3bcda6f4bf8b537fd17e00afd0d6dfd1f957c Mon Sep 17 00:00:00 2001 From: yaroslav8765 Date: Wed, 8 Apr 2026 13:09:36 +0300 Subject: [PATCH] docs: update docs for the 2fa plugin --- .../tutorial/08-Plugins/02-TwoFactorsAuth.md | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/adminforth/documentation/docs/tutorial/08-Plugins/02-TwoFactorsAuth.md b/adminforth/documentation/docs/tutorial/08-Plugins/02-TwoFactorsAuth.md index 819938e70..eb0ade800 100644 --- a/adminforth/documentation/docs/tutorial/08-Plugins/02-TwoFactorsAuth.md +++ b/adminforth/documentation/docs/tutorial/08-Plugins/02-TwoFactorsAuth.md @@ -229,7 +229,7 @@ So such users will have suggestion to setup 2FA, but will be able to skip it wit You might want to to allow to call some custom critical/money related actions with additional 2FA approval. This eliminates risks caused by user cookies theft by some virous/doorway software after login. -To do it, first, create frontend custom component which wraps and intercepts click event to menu item, and in click handler do a call to `window.adminforthTwoFaModal.getCode(cb?)` frontend API exposed by this plugin. This is awaitable call wich shows 2FA popup and asks user to authenticate with 2nd factor (if passkey is enabled it will be suggested first, with ability to fallback to TOTP) +To do it, first, create frontend custom component which wraps and intercepts click event to menu item, and in click handler do a call to `get2FaConfirmationResult` frontend API exposed by this plugin. This is awaitable call wich shows 2FA popup and asks user to authenticate with 2nd factor (if passkey is enabled it will be suggested first, with ability to fallback to TOTP) ```ts title='/custom/RequireTwoFaGate.vue' @@ -333,20 +335,19 @@ Frontend (Save Interceptor component injected via pageInjections): ```vue title='/custom/SaveInterceptor.vue'