chg: [appcontroller] Breadcrumbs and notifications are fetched only if the user is logged in

pull/93/head
Sami Mokaddem 2022-01-25 11:29:50 +01:00
parent 249892c3e0
commit dd3a1b8a15
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 5 additions and 3 deletions

View File

@ -153,9 +153,11 @@ class AppController extends Controller
public function beforeRender(EventInterface $event)
{
if (!$this->ParamHandler->isRest()) {
$this->set('breadcrumb', $this->Navigation->getBreadcrumb());
$this->set('notifications', $this->Notification->getNotifications());
if (!empty($this->request->getAttribute('identity'))) {
if (!$this->ParamHandler->isRest()) {
$this->set('breadcrumb', $this->Navigation->getBreadcrumb());
$this->set('notifications', $this->Notification->getNotifications());
}
}
}