]> git.immae.eu Git - github/bastienwirtz/homer.git/commitdiff
feat(auth): handle unauthorized request in connectivity
authorPierre <397503+bemble@users.noreply.github.com>
Mon, 16 May 2022 12:52:46 +0000 (14:52 +0200)
committerPierre <397503+bemble@users.noreply.github.com>
Mon, 16 May 2022 12:52:46 +0000 (14:52 +0200)
Reload page without cache if 401 and 403 status in response

src/components/ConnectivityChecker.vue

index 1c677d24a068c1ef742ea7060027a786010702ee..0d7e79fb475950d4f1a6dd21c8d62e3d283ca9fc 100644 (file)
@@ -63,7 +63,7 @@ export default {
       })
         .then(function (response) {
           // opaqueredirect means request has been redirected, to auth provider probably
-          if (response.type === "opaqueredirect" && !response.ok) {
+          if ((response.type === "opaqueredirect" && !response.ok) || [401, 403].indexOf(response.status) != -1) {
             window.location.href = window.location.href + "?t="+(new Date().valueOf());
           }
           that.offline = !response.ok;