I have created a custom authentication page for login.
If WordPress admin is open in 2 tabs and I log out of one tab or the session expires, the login form appears as usual in a modal on the open WordPress admin page.
However, after logging into the modal, the dashboard appears in the modal instead of closing the modal and reloading the dashboard or the current page.