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