hey community!
I have found a strange error in my panel, it appeared in 3.7.5 and now after updating also in 3.9.8 and it’s is reproducible on my site with the following steps:
- login to panel
- logout from panel
- keep login page open
after some time, the panel starts doing requests:
POST to https://mydomain.local/api/auth/ping (in version 3.9.8)
POST to https://mydomain.tld/api/auth (in version 3.7.5)
all these requests run into a timeout and return a 500 Internal Server Error and sometimes 503. This creates a loop, the request is started after some time again and producing the same error.
Initiator:
after this happens, I cannot login again, even with refresh. It only works after removing the session cookie, then everything works perfectly fine again.
What is happening here? Why are these requests running into an error?
This happens on my local machine as well as on my production server.
UPDATE
looks like I’ve found the issue:
I’m using the “completely different blueprint sets per user role” from Going beyond Kirby's permissions features | Kirby CMS.
There I made this changes to index.php:
$dir = __DIR__;
require 'kirby/bootstrap.php';
$kirby = new Kirby();
$currentUser = $kirby->user();
if ($currentUser && $currentUser->role()->name() === 'editor' ){
$kirby = new Kirby([
'roots' => [
'blueprints' => $dir . '/site/plugins/role-blueprints/blueprints/editor/',
],
]);
} else {
$kirby = new Kirby([
'roots' => [
'blueprints' => $dir . '/site/plugins/role-blueprints/blueprints/admin/',
],
]);
}
echo $kirby->render();
if I remove the if-block, the ping-requests work again.