Retrieves the token expiration timestamp
Gets the expiration time for the current access token. Dynamically imports the token module to avoid circular dependencies.
This function:
Promise resolving to expiry timestamp (milliseconds since epoch) or null
// Check if token expires soon and needs refreshconst expiry = await getTokenExpiry();if (expiry) { const timeUntilExpiry = expiry - Date.now(); if (timeUntilExpiry < 300000) { // Less than 5 minutes await refreshAccessToken(); }} Copy
// Check if token expires soon and needs refreshconst expiry = await getTokenExpiry();if (expiry) { const timeUntilExpiry = expiry - Date.now(); if (timeUntilExpiry < 300000) { // Less than 5 minutes await refreshAccessToken(); }}
export async function getTokenExpiry(): Promise<number | null> { const mod = await import("./storage/token-operations"); return mod.getTokenExpiry();} Copy
export async function getTokenExpiry(): Promise<number | null> { const mod = await import("./storage/token-operations"); return mod.getTokenExpiry();}
Retrieves the token expiration timestamp
Gets the expiration time for the current access token. Dynamically imports the token module to avoid circular dependencies.
This function: