demarches-normaliennes/app/javascript/packs
Pierre de La Morinerie 8dce7d59ed js: redirect to sign-in when a ujs link_to receives a 401
Before, when a 401 was received by a ujs-enabled link (like `link_to …,
method: :delete, data: { remote: true }`, rails-ujs tried to insert the
response text as a Javascript script.

As the script was something like `Please sign-in`, which is not valid
Javascript, the browser would throw an "Unexpected token" error.

The typical use-case is:

1. The user open a form in a tab,
2. The user disconnects in another tab,
3. In the first tab, the user clicks on a remote "Delete" link_to

In that case the browser raised an error in the console (and in Sentry),
but the user would see nothing.

With this commit, all 401 ujs errors are turned into redirects to the
sign-in page.

Fix https://sentry.io/organizations/demarches-simplifiees/issues/2522512693/activity/
2021-09-07 16:45:52 -05:00
..
application.js js: redirect to sign-in when a ujs link_to receives a 401 2021-09-07 16:45:52 -05:00
manager.js Fix global jQuery usage 2018-08-01 11:55:35 +02:00
track-admin.js Add crisp 2019-06-05 17:41:47 +02:00
track.js Move all the trackers to a separate js pack 2019-04-02 17:33:53 +02:00