Skip to content
Snippets Groups Projects
Commit 9b6d698e authored by Eduardo Alvarez Fernandez's avatar Eduardo Alvarez Fernandez
Browse files

Fix cache problem when non admin users access the site.

There is a bug in the cern_toolbar that caches the username and users
visiting see other people's usernames. This causes major confusion. To
reproduce it I needed to create two service accounts that do not have
administrator access.
Steps to reproduce:
 - in a private window login with srvaccount1
 - observe srvaccount1 in the toolbar and close the private window
 - in a new private window login with srvaccount2
 - observe srvaccount1 in the toolbar again
parent 5d46199a
Branches FixCacheUsername
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@ type: module
description: "Provides CERN Toolbar. The CERN Toolbar is obligatory for all CERN Drupal websites so make sure that the checkbox on the left is ticked."
core: 8.x
package: CERN Basic Elements
version: 1.0
dependencies:
- cookieconsent
- locale
\ No newline at end of file
......@@ -56,6 +56,7 @@ function cern_toolbar_page_top(array &$page_top) {
'#type' => 'cern_toolbar',
'#cache' => [
'tags' => ['cern_toolbar'],
'contexts' => ['user'],
],
];
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment