getodk / getodk/central

Show alert if request to restore session results in 500 error

Open
#1,092 1 comment 1 reaction 0 assignees View on GitHub
frontend
Dominant language
JavaScript
Stars
226
Forks
235
Avg merge
2d 22h
Merged PRs (30d)
19

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.