front > login : fix redirection when user is already logged in
This commit is contained in:
parent
e30a80c4ff
commit
619e124fc4
3 changed files with 25 additions and 14 deletions
|
|
@ -1,6 +1,10 @@
|
|||
<?php
|
||||
|
||||
return function ($page, $kirby, $site) {
|
||||
if (!$kirby->user() && $page->uri() !== 'login') {
|
||||
go('/login');
|
||||
}
|
||||
|
||||
$data = $page->toArray();
|
||||
$data['template'] = (string) $page->template();
|
||||
$data['newInspirations'] = (bool) page('inspirations')->children()->findBy('new', 'true');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue