From 7d61e490e5445361212559d6ebd477c9c5b97a9a Mon Sep 17 00:00:00 2001 From: creeper123123321 <7974274+creeper123123321@users.noreply.github.com> Date: Mon, 20 Dec 2021 21:26:36 -0300 Subject: [PATCH] logout on 403 code, close #189 --- src/main/resources/web/js/page.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/resources/web/js/page.js b/src/main/resources/web/js/page.js index 9607e1c..30d2aa0 100644 --- a/src/main/resources/web/js/page.js +++ b/src/main/resources/web/js/page.js @@ -452,6 +452,13 @@ class MojangAccount extends McAccount { }), headers: {"content-type": "application/json"}, }) + .then(r => { + if (r.status == 403) { + this.logout(); + throw "403, token expired?"; + } + return r; + }) .then(checkFetchSuccess("code")) .then(r => r.json()) .then(json => {