Is there something I don’t see why this is not working? Trying to limit a route defined in a plugin to logged-in users only:
Kirby::plugin('my/plugin', [
'routes' => [
[
'pattern' => 'protectedpage',
'action' => function () {
if ( kirby()->user() ) :
// do stuff
The condition evaluates as false, even while I am logged in, as kirby()->user()
is null - as the error message tells me when trying kirby()->user()->isLoggedIn()
Thank you for your help!