Subscription refresh: refresh the page on a 403

A 403 indicates the session isn't valid any more, and a window reload will
fix that (either by automatically logging in via Blender ID or by
providing a login prompt).
This commit is contained in:
2017-11-17 12:13:25 +01:00
parent 9dfe75ed1e
commit 59d165b6d0

View File

@@ -59,7 +59,13 @@ script.
.done(function() {
window.location.reload();
})
.fail(function() {
.fail(function(err) {
if (err.status == 403) {
/* This happens when we are no longer logged in properly, so just refresh the
* page to get a proper status. */
window.location.reload();
return;
}
alert('Unable to update subscription, please check your internet connection.');
})
;