From 038120485559ddb6277d5bc96a22223f2568150c Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 6 Jul 2021 18:37:06 +0100 Subject: [PATCH] Don't reload client app on 403, just show an error instead --- packages/client/src/api/api.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/client/src/api/api.js b/packages/client/src/api/api.js index fcdd9dbd5b..280b580164 100644 --- a/packages/client/src/api/api.js +++ b/packages/client/src/api/api.js @@ -43,10 +43,9 @@ const makeApiCall = async ({ method, url, body, json = true }) => { case 400: return handleError(`${url}: Bad Request`) case 403: - // reload the page incase the token has expired - if (!url.includes("self")) { - location.reload() - } + notificationStore.danger( + "Your session has expired, or you don't have permission to access that data" + ) return handleError(`${url}: Forbidden`) default: if (response.status >= 200 && response.status < 400) {