diff --git a/webapp/src/components/auth/AuthManager.js b/webapp/src/components/auth/AuthManager.js index d88284f9..b94db36e 100644 --- a/webapp/src/components/auth/AuthManager.js +++ b/webapp/src/components/auth/AuthManager.js @@ -79,11 +79,13 @@ export default class AuthManager { if (response.status === HttpStatusCode.Ok) { this.#saveToken(response); AuthManager.#instance.setLoggedIn(true); - } else { + } + } catch (error) { + if (error.response.status === HttpStatusCode.Forbidden) { localStorage.removeItem("jwtRefreshToken"); + } else { + console.error("Error refreshing token: ", error); } - } catch (error) { - console.error("Error refreshing token: ", error); } }