Skip to content

Commit ff6f026

Browse files
committed
Fix "user-not-logged-in" error on Panel login
Closes #7.
1 parent f51f94f commit ff6f026

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/config/areas.php

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

3+
use Kirby\Exception\LogicException;
34
use LukasBestle\Versions\Plugin;
45

56
return [
67
'versions' => function ($kirby) {
7-
$accessPermission = Plugin::instance()->hasPermission('access');
8+
try {
9+
$accessPermission = Plugin::instance()->hasPermission('access');
10+
} catch (LogicException $e) {
11+
// area was loaded by Kirby without a logged-in user
12+
$accessPermission = false;
13+
}
814

915
return [
1016
'label' => t('view.versions'),

0 commit comments

Comments
 (0)