demarches-normaliennes/app/javascript/new_design/dossiers
Pierre de La Morinerie e1909ed29f brouillon: redirect to sign-in when disconnected
There are two cases where the draft auto-save might fail because the
user is no longer authenticated:

- The user signed-out in another tab,
- The brower quit and re-opened, so the Session cookie expired.

In both cases, the auto-save will never succeed until the user
authenticates again, so displaying a "Retry" button is cruel.

Moreover, in plus of all auto-save requests failing with a small error,
the actual hard failure only occurs after filling all the form and
trying to submit it. Then the user is redirected to the sign-in page –
but all their changes are lost.

Instead, we now redirect to the sign-in page on the first 401 error
during the auto-save, let the user sign-in, and then redirect back to
the form.
2021-07-22 11:58:02 +02:00
..
auto-save-controller.js js: fix typo in comment 2021-07-22 11:58:01 +02:00
auto-save.js brouillon: redirect to sign-in when disconnected 2021-07-22 11:58:02 +02:00
auto-upload-controller.js javascript: human-readable message for reading errors during upload 2020-05-14 13:29:54 +02:00
auto-upload.js fix new prettier defaults 2020-05-12 18:18:37 +02:00
auto-uploads-controllers.js javascript: remove debug code for FileReader errors 2020-05-14 13:29:54 +02:00