MCPcopy Create free account
hub / github.com/Noumena-Network/code / isOAuthTokenExpired

Function isOAuthTokenExpired

src/services/oauth/client.ts:480–489  ·  view source on GitHub ↗
(expiresAt: number | null)

Source from the content-addressed store, hash-verified

478}
479
480export 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
491export async function fetchProfileInfo(accessToken: string, timeout = 10000): Promise<{
492 subscriptionType: SubscriptionType | null

Calls

no outgoing calls

Tested by

no test coverage detected