From f7703ff9f708c8c26e506ed59ac331fe94cc65ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?L=C3=A9o=20Banno-Cloutier?=
 <leo.banno-cloutier@savoirfairelinux.com>
Date: Wed, 12 Jul 2023 11:09:49 -0400
Subject: [PATCH] jams-react-client: fix react-error-overlay

Change-Id: I56736e0c0d643b1bcd56f93a8bd2af2143d8fe88
---
 jams-react-client/package.json |  2 +-
 jams-react-client/src/auth.js  | 17 +++++++++++------
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/jams-react-client/package.json b/jams-react-client/package.json
index a9b9322a..af5a01ca 100644
--- a/jams-react-client/package.json
+++ b/jams-react-client/package.json
@@ -72,7 +72,7 @@
     "i18next-parser": "^3.3.0",
     "i18next-scanner": "^2.11.0",
     "prettier": "2.8.8",
-    "react-error-overlay": "^6.0.9"
+    "react-error-overlay": "6.0.9"
   },
   "browserslist": {
     "production": [
diff --git a/jams-react-client/src/auth.js b/jams-react-client/src/auth.js
index e19d77d0..ec3b15a6 100644
--- a/jams-react-client/src/auth.js
+++ b/jams-react-client/src/auth.js
@@ -173,12 +173,17 @@ class Auth {
 
   checkForUpdates(cb) {
     if (this.installed && this.authenticated) {
-      axios(
-        configApiCall(api_path_get_subscription_status, "GET", null, null)
-      ).then((response) => {
-        this.activated = response.data["activated"];
-        cb();
-      });
+      axios(configApiCall(api_path_get_subscription_status, "GET", null, null))
+        .then((response) => {
+          this.activated = response.data["activated"];
+          cb();
+        })
+        .catch((error) => {
+          if (error.response.status === 401) {
+            this.authenticated = false;
+          }
+          cb();
+        });
     } else {
       axios(
         configApiCall(api_path_get_install_lastKnownStep, "GET", null, null)
-- 
GitLab