Skip to content

Commit 45e1fdf

Browse files
committed
refact: User security TOTP drawer
1 parent 8fc034a commit 45e1fdf

File tree

19 files changed

+503
-547
lines changed

19 files changed

+503
-547
lines changed

config/areas/account/dialogs.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
use Kirby\Panel\Controller\Dialog\UserTotpEnableDialogController;
4-
53
$dialogs = require __DIR__ . '/../users/dialogs.php';
64

75
return [
@@ -61,12 +59,4 @@
6159
...$dialogs['user.file.sections'],
6260
'pattern' => '(account)/files/(:any)/sections/(:any)/(:all?)',
6361
],
64-
'account.totp.enable' => [
65-
'pattern' => '(account)/totp/enable',
66-
'action' => UserTotpEnableDialogController::class
67-
],
68-
'account.totp.disable' => [
69-
...$dialogs['user.totp.disable'],
70-
'pattern' => '(account)/totp/disable',
71-
],
7262
];

config/areas/account/drawers.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
...$drawers['user.security.method.code'],
1212
'pattern' => '(account)/security/method/code',
1313
],
14+
'account.security.challenge.totp' => [
15+
...$drawers['user.security.challenge.totp'],
16+
'pattern' => '(account)/security/challenge/totp',
17+
],
1418
'account.fields' => [
1519
...$drawers['user.fields'],
1620
'pattern' => '(account)/fields/(:any)/(:all?)',

config/areas/users/dialogs.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use Kirby\Panel\Controller\Dialog\UserChangeRoleDialogController;
1414
use Kirby\Panel\Controller\Dialog\UserCreateDialogController;
1515
use Kirby\Panel\Controller\Dialog\UserDeleteDialogController;
16-
use Kirby\Panel\Controller\Dialog\UserTotpDisableDialogController;
1716

1817
return [
1918
'user.create' => [
@@ -44,10 +43,6 @@
4443
'pattern' => 'users/(:any)/delete',
4544
'action' => UserDeleteDialogController::class
4645
],
47-
'user.totp.disable' => [
48-
'pattern' => 'users/(:any)/totp/disable',
49-
'action' => UserTotpDisableDialogController::class
50-
],
5146

5247
'user.fields' => [
5348
'pattern' => '(users/[^/]+)/fields/(:any)/(:all?)',

config/areas/users/drawers.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
use Kirby\Panel\Controller\Drawer\SectionDrawerController;
55
use Kirby\Panel\Controller\Drawer\UserSecurityCodeMethodDrawerController;
66
use Kirby\Panel\Controller\Drawer\UserSecurityDrawerController;
7+
use Kirby\Panel\Controller\Drawer\UserTotpDrawerController;
78

89
return [
910
'user.security' => [
@@ -14,6 +15,10 @@
1415
'pattern' => 'users/(:any)/security/method/code',
1516
'action' => UserSecurityCodeMethodDrawerController::class
1617
],
18+
'user.security.challenge.totp' => [
19+
'pattern' => 'users/(:any)/security/challenge/totp',
20+
'action' => UserTotpDrawerController::class
21+
],
1722
'user.fields' => [
1823
'pattern' => '(users/[^/]+)/fields/(:any)/(:all?)',
1924
'action' => FieldDrawerController::class

i18n/translations/en.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,6 @@
549549
"login.totp.enable.qr.help": "Unable to scan? Add the setup key <code>{secret}</code> manually to your authenticator app.",
550550
"login.totp.enable.confirm.headline": "2. Confirm with generated code",
551551
"login.totp.enable.confirm.text": "Your app generates a new one‑time code every 30 seconds. Enter the current code to complete the setup:",
552-
"login.totp.enable.confirm.label": "Current code",
553552
"login.totp.enable.confirm.help": "After this setup, we will ask you for a one‑time code every time you log in.",
554553
"login.totp.enable.success": "One‑time codes enabled",
555554
"login.totp.disable.option": "Disable one‑time codes",

panel/src/components/Dialogs/TotpDialog.vue

Lines changed: 0 additions & 125 deletions
This file was deleted.

panel/src/components/Dialogs/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import RemoveDialog from "./RemoveDialog.vue";
2121
import RequestErrorDialog from "./RequestErrorDialog.vue";
2222
import SearchDialog from "./SearchDialog.vue";
2323
import TextDialog from "./TextDialog.vue";
24-
import TotpDialog from "./TotpDialog.vue";
2524
import UploadDialog from "./UploadDialog.vue";
2625
import UploadReplaceDialog from "./UploadReplaceDialog.vue";
2726

@@ -54,7 +53,6 @@ export default {
5453
app.component("k-request-error-dialog", RequestErrorDialog);
5554
app.component("k-search-dialog", SearchDialog);
5655
app.component("k-text-dialog", TextDialog);
57-
app.component("k-totp-dialog", TotpDialog);
5856
app.component("k-upload-dialog", UploadDialog);
5957
app.component("k-upload-replace-dialog", UploadReplaceDialog);
6058

panel/src/components/Drawers/Elements/Header.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
</ol>
1616
</nav>
1717
<k-drawer-tabs :tab="tab" :tabs="tabs" @open="$emit('tab', $event)" />
18+
1819
<nav class="k-drawer-options">
1920
<slot />
2021
<k-button class="k-drawer-option" icon="check" type="submit" />

0 commit comments

Comments
 (0)