(input: {
readonly expiresAt: number | null;
readonly now?: number;
readonly skewMs?: number;
})
| 972 | * signal. Keep the two paths in sync — narrowing the reactive retry strands |
| 973 | * every null-expiry connection with no way to recover short of a reconnect. */ |
| 974 | export const shouldRefreshToken = (input: { |
| 975 | readonly expiresAt: number | null; |
| 976 | readonly now?: number; |
| 977 | readonly skewMs?: number; |
| 978 | }): boolean => { |
| 979 | if (input.expiresAt === null) return false; |
| 980 | const now = input.now ?? Date.now(); |
| 981 | const skew = input.skewMs ?? OAUTH2_REFRESH_SKEW_MS; |
| 982 | return input.expiresAt <= now + skew; |
| 983 | }; |
no outgoing calls
no test coverage detected