- Issue created by @emanuelcoelho
- 🇮🇳India sandip
Hi @emanuelcoelho,
I think we can check the authenticated user condition infunction autologout_page_attachments_alter(array &$attachments)
from wherefunction autologout_attach_js(array &$element, array $settings)
is called.
If you agree i will start working on it. - Merge request !73Issue #3498529: Add JS file only when user is authenticated → (Open) created by Unnamed author
Everything looks perfect.
For me it's a go.Thank you for the quick response.
Hey @emanuelcoelho,
I have tried reproducing your issue but the libraries mentioned above are not being attached for anonymous users and is only being attached for authenticated users. So, I don't think we will need any validation here. I think the validation is already present for anonymous users.
// If user is anonymous. if ($user->id() == 0) { return TRUE; }
The above validation present in the
autologout_autologout_prevent()
method is validating for anonymous users.Please provide detailed steps to replicate the issue, if I am missing something here.
I am using Drupal 11 and 2.x-dev version of the Module here. I am attaching screenshots for the reference.
Thanks !- Status changed to Needs review
23 days ago 11:38am 2 April 2025 I have tested the module, and I observed that the autologout.js file is not loading for anonymous users but is correctly loading for authenticated users. This behavior occurs without applying the proposed patch.
Since the reported issue was about autologout.js making unnecessary requests for anonymous users, but that is not happening in the 2.x-dev version, this might already be resolved.
Can anyone confirm if this issue still exists in any specific scenario?
Moving the issue to NR for now.