getodk / central-frontend

Vue.js based frontend for ODK Central

Home Page:https://docs.getodk.org/central-intro/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Show alert if request to restore session results in 500 error

matthew-white opened this issue · comments

Right now the following sequence is possible:

  • Log into Frontend.
  • The server has a problem and starts returning 500 errors.
  • Attempt to log into Frontend in a new tab.
  • No server error is shown. The login form is shown, but it cannot be submitted: if the user tries to submit it, Frontend shows the alert, "A user is already logged in. Please refresh the page to continue."

I think this sequence is part of what is happening in this forum post: https://forum.getodk.org/t/central-giving-login-access-issues/36746

Instead, I think Frontend should show the server error in this case. More specifically, if Frontend sends a request to restore the session, that request results in an error other than a 404, and the session expiration date is stored in local storage (preventing a submission of the login form), then the server error should be shown. In that case, the user will likely be redirected to the login page, where now they will see the server error. If the user tries to then submit the login form, they will still see "A user is already logged in." However, they will have more information than they do today.