diff --git a/frontend/sportsmatch-app/src/components/Navbar.tsx b/frontend/sportsmatch-app/src/components/Navbar.tsx index fc8910d2..c317fa2d 100644 --- a/frontend/sportsmatch-app/src/components/Navbar.tsx +++ b/frontend/sportsmatch-app/src/components/Navbar.tsx @@ -19,7 +19,7 @@ function Navbar() { setLoggedIn(true) } catch (error) { const code = (error as ApiError).status - if (code === 401 || code === 403) { + if (code === 400) { localStorage.removeItem('token') setLoggedIn(false) } diff --git a/frontend/sportsmatch-app/src/components/PrivateRoute.tsx b/frontend/sportsmatch-app/src/components/PrivateRoute.tsx index 8b731f2b..37f930bb 100644 --- a/frontend/sportsmatch-app/src/components/PrivateRoute.tsx +++ b/frontend/sportsmatch-app/src/components/PrivateRoute.tsx @@ -20,7 +20,7 @@ const PrivateRoute = () => { await ExSecuredEndpointService.getUserMainPage() } catch (error) { const code = (error as ApiError).status - if (code === 401 || code === 403) { + if (code === 400) { localStorage.removeItem('token') setAuthorized(false) }