MCPcopy
hub / github.com/codeaashu/claude-code / decodeJwtExpiry

Function decodeJwtExpiry

src/bridge/jwtUtils.ts:38–49  ·  view source on GitHub ↗
(token: string)

Source from the content-addressed store, hash-verified

36 * @returns The `exp` value in Unix seconds, or `null` if unparseable
37 */
38export function decodeJwtExpiry(token: string): number | null {
39 const payload = decodeJwtPayload(token)
40 if (
41 payload !== null &&
42 typeof payload === 'object' &&
43 'exp' in payload &&
44 typeof payload.exp === 'number'
45 ) {
46 return payload.exp
47 }
48 return null
49}
50
51/** Refresh buffer: request a new token before expiry. */
52const TOKEN_REFRESH_BUFFER_MS = 5 * 60 * 1000

Callers 2

scheduleFunction · 0.85
requestMethod · 0.85

Calls 1

decodeJwtPayloadFunction · 0.85

Tested by

no test coverage detected