MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / tryRefresh

Method tryRefresh

packages/cli/src/auth/client.ts:164–175  ·  view source on GitHub ↗
(refresh_token: string)

Source from the content-addressed store, hash-verified

162 }
163
164 private async tryRefresh(refresh_token: string): Promise<OAuthTokens | null> {
165 if (!this.onRefresh) return null;
166 try {
167 return await this.onRefresh(refresh_token);
168 } catch (err) {
169 // Refresh failure should be surfaced upstream by the caller via
170 // the retry's 401, not by throwing here — so callers consistently
171 // see "please log in again" rather than mixed error types.
172 if (isAuthError(err) && err.code === "REFRESH_FAILED") return null;
173 throw err;
174 }
175 }
176}
177
178export function buildAuthHeaders(credential: ResolvedCredential): Record<string, string> {

Callers 1

fetchUserMethod · 0.95

Calls 1

isAuthErrorFunction · 0.85

Tested by

no test coverage detected