- ๐บ๐ธUnited States jeffschuler Boulder, Colorado
We're experiencing this too, just as you lay out in the "steps to reproduce", and your changes fix the issue.
I don't know the internals here very well, but this comment in
BasicAuth::challengeException()
:// 2. Have the 'config:user.role.anonymous' cache tag, because the only // reason this 401 would no longer be a 401 is if permissions for the // 'anonymous' role change, causing the cache tag to be invalidated.
...does seem to leave out the possibility that a 401 would no longer be a 401 because changing an entity status to Published gives the anonymous user access.
Here are your changes as a patch against 11.x-dev. That patch is applying and working in 10.2.2 as well.
- Status changed to Needs work
8 months ago 7:36pm 28 January 2024 - ๐บ๐ธUnited States smustgrave
Thanks for reporting, will need test coverage to show the issue.
Also recommend using an MR as patches are being phased out.
- ๐ฎ๐ณIndia samit.310@gmail.com
samit.310@gmail.com โ made their first commit to this issueโs fork.
- ๐ฎ๐ณIndia samit.310@gmail.com
HI @jeffschuler,
The
4xx-response
Cache tag is already there while following the Steps to reproduce You can checkcore/lib/Drupal/Core/EventSubscriber/ClientErrorResponseSubscriber.php
, TheonRespond
function is used toSets the '4xx-response' cache tag on 4xx responses.
I am also adding adding the working screenshots.
Not sure but it might be because of some other contrib modules that you are using.
My Drupal Version is 11.x and PHP is 8.3.10.
Thanks
Samit K.