Upgrade to 3.7.2

This commit is contained in:
Bastian Allgeier
2022-07-27 15:34:32 +02:00
parent 1ad1eaf387
commit 833f327139
26 changed files with 204 additions and 66 deletions

View File

@@ -2,7 +2,6 @@
use Kirby\Cms\App;
use Kirby\Cms\Find;
use Kirby\Panel\Panel;
return [
'account' => [
@@ -18,16 +17,6 @@ return [
return Find::file('account', $filename)->panel()->view();
}
],
'account.logout' => [
'pattern' => 'logout',
'auth' => false,
'action' => function () {
if ($user = App::instance()->user()) {
$user->logout();
}
Panel::go('login');
},
],
'account.password' => [
'pattern' => 'reset-password',
'action' => fn () => ['component' => 'k-reset-password-view']

21
kirby/config/areas/logout.php Executable file
View File

@@ -0,0 +1,21 @@
<?php
use Kirby\Panel\Panel;
use Kirby\Toolkit\I18n;
return function ($kirby) {
return [
'icon' => 'user',
'label' => I18n::translate('logout'),
'views' => [
'logout' => [
'pattern' => 'logout',
'auth' => false,
'action' => function () use ($kirby) {
$kirby->auth()->logout();
Panel::go('login');
},
]
]
];
};