]> git.immae.eu Git - github/bastienwirtz/homer.git/commitdiff
fix(auth): add timestamp in URL to prevent infinite redirection loop
authorPierre <397503+bemble@users.noreply.github.com>
Tue, 10 May 2022 07:46:42 +0000 (09:46 +0200)
committerPierre <397503+bemble@users.noreply.github.com>
Tue, 10 May 2022 07:46:42 +0000 (09:46 +0200)
src/components/ConnectivityChecker.vue

index a717bcf0389fa3bf5667f119102d2f91475dc09b..1c677d24a068c1ef742ea7060027a786010702ee 100644 (file)
@@ -17,6 +17,9 @@ export default {
     };
   },
   created: function () {
+    if (/t=\d+/.test(window.location.href)) {
+      window.history.replaceState({}, document.title, window.location.pathname);
+    }
     let that = this;
     this.checkOffline();
 
@@ -61,7 +64,7 @@ export default {
         .then(function (response) {
           // opaqueredirect means request has been redirected, to auth provider probably
           if (response.type === "opaqueredirect" && !response.ok) {
-            window.location.reload(true);
+            window.location.href = window.location.href + "?t="+(new Date().valueOf());
           }
           that.offline = !response.ok;
         })