mirror of
https://github.com/bastienwirtz/homer.git
synced 2025-11-14 17:15:53 +01:00
feat(auth): handle unauthorized request in connectivity
Reload page without cache if 401 and 403 status in response
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user