From 6db7e4a637474f240bebe0c6b421dc0deebc2567 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 8 Apr 2021 10:43:47 +0300 Subject: [PATCH] Fixed `You have been logged out` message when entering to 2FA authentication due to `/admin/task:getNotifications` AJAX call [#2109] --- CHANGELOG.md | 6 ++++++ themes/grav/templates/partials/javascript-config.html.twig | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e6841a1..fe4d5a07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v1.10.11 +## mm/dd/2021 + +1. [](#bugfix) + * Fixed `You have been logged out` message when entering to 2FA authentication due to `/admin/task:getNotifications` AJAX call [#2109](https://github.com/getgrav/grav-plugin-admin/issues/2109) + # v1.10.10 ## 04/07/2021 diff --git a/themes/grav/templates/partials/javascript-config.html.twig b/themes/grav/templates/partials/javascript-config.html.twig index 6290dcdf..6e75b3db 100644 --- a/themes/grav/templates/partials/javascript-config.html.twig +++ b/themes/grav/templates/partials/javascript-config.html.twig @@ -1,4 +1,4 @@ -{% if authorize(['admin.login', 'admin.super']) %} +{% if user.authorized and authorize(['admin.login', 'admin.super']) %} {% set notifications = (config.plugins.admin.widgets['dashboard-notifications'] or config.plugins.admin.notifications.dashboard or config.plugins.admin.notifications.plugins or config.plugins.admin.notifications.themes) ? 1 : 0 %} {% switch template_route %} {% case 'dashboard' %}