From 59d165b6d076d68c8935d4df59fcd86c206c5da2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 17 Nov 2017 12:13:25 +0100 Subject: [PATCH] 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). --- src/templates/users/settings/billing.pug | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/templates/users/settings/billing.pug b/src/templates/users/settings/billing.pug index e11965f..1cb0069 100644 --- a/src/templates/users/settings/billing.pug +++ b/src/templates/users/settings/billing.pug @@ -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.'); }) ;