Allow Non admin users to clear varnish

Created on 10 June 2022, over 2 years ago
Updated 17 March 2024, 9 months ago

Problem/Motivation

Non admin users see 404 page after hitting purge URL. The error log

Drupal\Core\Http\Exception\CacheableAccessDeniedHttpException: 'csrf_token' URL query argument is invalid. in Drupal\Core\Routing\AccessAwareRouter->checkAccess() (line 118 of /var/www/html/docroot/core/lib/Drupal/Core/Routing/AccessAwareRouter.php).

Steps to reproduce

Install Acquia Purge Varnish [Dev Version] module
Fill the credentials for API Key & Secret
Save it
Try clearing as admin, it works
Allow a non-admin role to access the purge
Add the Purge URL in shortcut
Upon hitting it takes you to a 403 page

This is working fine if a non-admin uses the Configuration->Acquia Purge Varnish->Purge Varnish menu

csrf_token seems to be invalid.

A proposed solution could be

Build a page with Clear Varnish link, so the csrf_token gets generated on the page itself. The downside is it increases one more click

Feature request
Status

Closed: outdated

Version

1.0

Component

Code

Created by

🇮🇳India lakshmanDrupal Delhi NCR

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024