wupengfei
2025-03-24 80dd2bebbe3d204cc7833a4793aba67bba356b1d
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;
}