There should be a global ExceptionHandler for authentication-related errors, like InvalidLoginException, InvalidSessionException and E_GUEST_ONLY.
They can simply redirect to login or to the dashboard, depending on the case.
I'm working on a solution for this on my project and plan to PR this soon here.