Problem/Motivation
In the logout message we'd like to include a link back to the login screen. Like this You have been logged out due to inactivity. You may <a href="/user/login">click here to log back in</a>.
Steps to reproduce
- Using Drupal 9.5 and autologout 1.4
- Set your logout message to include HTML markup

- Await for the logout timeout to occur and reload your page to view the inactivity message
- See markup is not rendered.

Proposed resolution
Adjust code for the inactivityMessage() method in the AutologoutManager to use FormattedMarkup which will allow the message to have rendered markup.
Remaining tasks
Is this the correct place to resolve this? Or is there somewhere else that this should be adjusted?
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | auto-logout-message-2.png | 8.86 KB | inregards2pluto |
| #11 | autologout_message.png | 14.22 KB | vinodhini.e |
| Screenshot 2023-06-15 at 10.20.54 AM.png | 24.46 KB | carsoncho | |
| image (16).png | 18.87 KB | carsoncho |
Issue fork autologout-3367062
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
admirlju commentedComment #4
admirlju commentedMessed up the rebase a bit. Fixed it now, testing your changes to see if everything works like it's supposed to.
Comment #5
admirlju commentedThe tests are passing here and locally, manual tests also work as the request intends it to. I'm for now leaving it as needs review, because of the mess up I did with rebase, just so people can make sure everything works. But it should be able to merge without a problem now.
Comment #10
deaom commentedRebased the MR #33 and solved conflicts, cherry picked the commit and added it to the new branch, which targets the 2.x branch. Changing the version to the latest one, 2.x and leaving the status to needs review.
Comment #11
vinodhini.e commentedHi, Installed the module on a Drupal 10.5.1 site.
Observed the issue: Initially, the logout message markup was not rendered correctly. The user was not shown any login link after being logged out.
Applied the patch from Merge Request #80, The logout message markup was rendered properly.
The message now correctly includes a login link, allowing users to log in again.
Comment #12
asrobChanged status based on @vinodhini.e's comment.
Comment #13
the_g_bomb commentedConfirmed RTBC
Comment #15
inregards2plutoRebased the branch to pull in changes from https://www.drupal.org/project/autologout/issues/3339695. Tested and verified that the fix is still working.
We should be good to go here barring some of the outstanding phpunit tests (which it might make more sense to fix prior to the new release after merging in the other work).
Comment #16
the_g_bomb commentedMerged