mirror of https://github.com/bastienwirtz/homer
feat(auth): handle unauthorized request in connectivity
Reload page without cache if 401 and 403 status in responsepull/448/head
parent
98b460d6fe
commit
4353f5e036
|
@ -63,7 +63,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) || [401, 403].indexOf(response.status) != -1) {
|
||||||
window.location.href = window.location.href + "?t="+(new Date().valueOf());
|
window.location.href = window.location.href + "?t="+(new Date().valueOf());
|
||||||
}
|
}
|
||||||
that.offline = !response.ok;
|
that.offline = !response.ok;
|
||||||
|
|
Loading…
Reference in New Issue