Currently, when the session expires or the user logs-out on a different tab, an error is shown in the document and the "publish" button remains active. This is problematic since (a) the user may not notice that the changes are not saved and continue working, and (b) we are not providing a clear path forward (just instructions on what to do).
The following is proposed:
- A dialog is shown when the issue is detected. It will block the user from further editing the document in order to avoid changes to get lost.
- A "log-in" action is provided that opens in a new tab/window.
- In the background, regular checks are made to verify if the issue still happens. If the issue is no longer happening, the dialog gets closed. We may want to pay special attention to the visibility change event to check if the user logged-in after returning from the other window.