Merge branch 'main' of github.com:joshfe/persian-game

This commit is contained in:
alij
2024-07-03 15:02:04 +03:30
5 changed files with 9 additions and 5 deletions

View File

@@ -9,12 +9,13 @@ const isTokenValid = (token: string): boolean => {
return !!token;
} catch (error) {
console.error("Token validation error:", error);
toast.error(`Token validation error:${error}`);
toast.error(`توکن کاربر منقضی شده است:${error}`);
return false;
}
};
export const IsAuthenticated = (): boolean => {
const { token } = useSelector((state: RootState) => state.token);
return isTokenValid(token);
};