(expiresAt: number | null)
| 478 | } |
| 479 | |
| 480 | export function isOAuthTokenExpired(expiresAt: number | null): boolean { |
| 481 | if (expiresAt === null || Number.isNaN(expiresAt)) { |
| 482 | return true |
| 483 | } |
| 484 | |
| 485 | const bufferTime = 5 * 60 * 1000 |
| 486 | const now = Date.now() |
| 487 | const expiresWithBuffer = now + bufferTime |
| 488 | return expiresWithBuffer >= expiresAt |
| 489 | } |
| 490 | |
| 491 | export async function fetchProfileInfo(accessToken: string, timeout = 10000): Promise<{ |
| 492 | subscriptionType: SubscriptionType | null |
no outgoing calls
no test coverage detected