Skip to content

Conversation

brettlaishley
Copy link

Request in #14 , this feature provides an admin UI modal that warns the admin user if they're within one minute of their session expiring.

I've taken a simple approach in the phtml file, but open to suggestions for improvement.

@brettlaishley brettlaishley requested a review from a team as a code owner October 7, 2025 04:18
harshaaligent
harshaaligent previously approved these changes Oct 7, 2025
Copy link

@harshaaligent harshaaligent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


<div id="session-expire-warning-modal">
<p style="font-size:48px;color:#FF0000">&#x26A0;</p>
<p>Your admin session will expire in one minute, please save your changes or refresh the page.</p>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to actually give the option to extend the session asynchronously? It would be more user-friendly.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to, but I might need a bit more guidance on how to do that.

Just exploring options now, I added a button to refresh the page, but what would be the best way to refresh the session without refreshing the entire page and potentially losing any unsvaed changes?

So far I just added this to the phtml:

    <button onclick="window.location.reload();">Refresh Page</button>

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trouble with just reloading the page is that the user is likely to lose whatever changes they've got. We should be able to execute an AJAX request that can renew their session, but remain on the page they're currently on.
Obviously, we'd require testing to make sure that whatever page they're editing remains saveable (no form key issues, etc.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants