spot: login state check
This commit is contained in:
parent
2253ac394d
commit
d8b3ea3902
1 changed files with 6 additions and 4 deletions
|
|
@ -167,10 +167,12 @@ const Router: React.FC<RouterProps> = (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])
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue