You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: adminforth/documentation/docs/tutorial/06-CLICommands.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -353,6 +353,19 @@ Generated example:
353
353
custom/OrderShowBottomExportButton.vue
354
354
```
355
355
356
+
Special position for create/edit:
357
+
-`saveButton` — replaces the default Save button at the top bar.
358
+
359
+
Example usage via interactive flow:
360
+
```bash
361
+
adminforth component
362
+
# → CRUD Page Injections
363
+
# → (create | edit)
364
+
# → Save button
365
+
```
366
+
367
+
Your generated component will receive props documented in Page Injections → Create/Edit custom Save button. At minimum, call `props.saveRecord()` on click and respect `props.saving`, `props.isValid`, and `props.disabled`.
Copy file name to clipboardExpand all lines: adminforth/documentation/docs/tutorial/07-Plugins/02-TwoFactorsAuth.md
+70-2Lines changed: 70 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -227,7 +227,7 @@ To do it, first, create frontend custom component which wraps and intercepts cli
227
227
asyncfunction onClick() {
228
228
if (props.disabled) return;
229
229
230
-
const verificationResult =awaitwindow.adminforthTwoFaModal.get2FaConfirmationResult(); // this will ask user to enter code
230
+
const verificationResult =awaitwindow.adminforthTwoFaModal.get2FaConfirmationResult(); // this will ask user to enter code
231
231
emit('callAction', { verificationResult }); // then we pass this verification result to action (from fronted to backend)
232
232
}
233
233
</script>
@@ -303,6 +303,74 @@ options: {
303
303
}
304
304
```
305
305
306
+
## Request 2FA for create/edit (secure save gating)
307
+
308
+
To protect create and edit operations, collect the result of the 2FA modal on the frontend and send it along with the save payload. The server must verify it before writing changes.
errors.push(`Resource "${res.resourceId}" has invalid pageInjection key "${key}", allowed keys are ${possiblePages.join(', ')}. ${similar ? `Did you mean "${similar}"?` : ''}`);
errors.push(`Resource "${res.resourceId}" has invalid pageInjection page "${pageKey}", allowed pages are ${possiblePages.join(', ')}. ${similar ? `Did you mean "${similar}"?` : ''}`);
errors.push(`Resource "${res.resourceId}" has invalid pageInjection key "${injection}", Supported keys are ${ConfigValidator.PAGE_INJECTION_KEYS.join(', ')}${similar ? `Did you mean "${similar}"?` : ''}`);
errors.push(`Resource "${res.resourceId}" has invalid pageInjection key "${injection}" for page "${pageKey}", supported keys are ${allowedForThisPage.join(', ')}.${similar ? `Did you mean "${similar}"?` : ''}`);
0 commit comments