(input: {
readonly expiresAt: number | null;
readonly now?: number;
readonly skewMs?: number;
})
| 821 | * signal. Keep the two paths in sync — narrowing the reactive retry strands |
| 822 | * every null-expiry connection with no way to recover short of a reconnect. */ |
| 823 | export const shouldRefreshToken = (input: { |
| 824 | readonly expiresAt: number | null; |
| 825 | readonly now?: number; |
| 826 | readonly skewMs?: number; |
| 827 | }): boolean => { |
| 828 | if (input.expiresAt === null) return false; |
| 829 | const now = input.now ?? Date.now(); |
| 830 | const skew = input.skewMs ?? OAUTH2_REFRESH_SKEW_MS; |
| 831 | return input.expiresAt <= now + skew; |
| 832 | }; |
no outgoing calls
no test coverage detected