Initial commit
This commit is contained in:
commit
73c6b816c0
716 changed files with 170045 additions and 0 deletions
43
kirby/config/areas/login.php
Normal file
43
kirby/config/areas/login.php
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
use Kirby\Panel\Panel;
|
||||
|
||||
return function ($kirby) {
|
||||
return [
|
||||
'icon' => 'user',
|
||||
'label' => t('login'),
|
||||
'views' => [
|
||||
'login' => [
|
||||
'pattern' => 'login',
|
||||
'auth' => false,
|
||||
'action' => function () use ($kirby) {
|
||||
$system = $kirby->system();
|
||||
$status = $kirby->auth()->status();
|
||||
return [
|
||||
'component' => 'k-login-view',
|
||||
'props' => [
|
||||
'methods' => array_keys($system->loginMethods()),
|
||||
'pending' => [
|
||||
'email' => $status->email(),
|
||||
'challenge' => $status->challenge()
|
||||
]
|
||||
],
|
||||
];
|
||||
}
|
||||
],
|
||||
'login.fallback' => [
|
||||
'pattern' => '(:all)',
|
||||
'auth' => false,
|
||||
'action' => function ($path) use ($kirby) {
|
||||
/**
|
||||
* Store the current path in the session
|
||||
* Once the user is logged in, the path will
|
||||
* be used to redirect to that view again
|
||||
*/
|
||||
$kirby->session()->set('panel.path', $path);
|
||||
Panel::go('login');
|
||||
}
|
||||
]
|
||||
]
|
||||
];
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue