wupengfei
2025-04-03 100740a5b4e512b5b3c9b3e9ecb467cb7384b791
1
2
3
4
5
6
export function tokenIsExpired(userInfo: API.IdentityModelTokenCacheItem) {
  const now = new Date().getTime();
  const expiresIn = userInfo.expiresIn;
  const expired = (now - new Date(userInfo.creationTime).getTime()) / 1000 >= expiresIn - 300;
  return expired;
}