forked from extern/homer
fix(auth): add timestamp in URL to prevent infinite redirection loop
This commit is contained in:
parent
bf2fcc6641
commit
98b460d6fe
@ -17,6 +17,9 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
created: function () {
|
created: function () {
|
||||||
|
if (/t=\d+/.test(window.location.href)) {
|
||||||
|
window.history.replaceState({}, document.title, window.location.pathname);
|
||||||
|
}
|
||||||
let that = this;
|
let that = this;
|
||||||
this.checkOffline();
|
this.checkOffline();
|
||||||
|
|
||||||
@ -61,7 +64,7 @@ export default {
|
|||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
// opaqueredirect means request has been redirected, to auth provider probably
|
// opaqueredirect means request has been redirected, to auth provider probably
|
||||||
if (response.type === "opaqueredirect" && !response.ok) {
|
if (response.type === "opaqueredirect" && !response.ok) {
|
||||||
window.location.reload(true);
|
window.location.href = window.location.href + "?t="+(new Date().valueOf());
|
||||||
}
|
}
|
||||||
that.offline = !response.ok;
|
that.offline = !response.ok;
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user