diff --git a/frontend/app/Router.tsx b/frontend/app/Router.tsx index 74ed041db..e440b57d2 100644 --- a/frontend/app/Router.tsx +++ b/frontend/app/Router.tsx @@ -167,10 +167,12 @@ const Router: React.FC = (props) => { useEffect(() => { if (isLoggedIn && (location.pathname.includes('login') || isSpotCb)) { - if (localSpotJwt && !isTokenExpired(localSpotJwt)) { - handleSpotLogin(localSpotJwt); - } else { - logout(); + if (localSpotJwt) { + if (!isTokenExpired(localSpotJwt)) { + handleSpotLogin(localSpotJwt); + } else { + logout(); + } } } }, [isSpotCb, location, isLoggedIn, localSpotJwt])