Closes #4342
This commit is contained in:
@@ -863,6 +863,7 @@ function createClient(
|
||||
sessionId && getAnthropicCompat(model).sendSessionAffinityHeaders ? { "x-session-affinity": sessionId } : {};
|
||||
const client = new Anthropic({
|
||||
apiKey,
|
||||
authToken: null,
|
||||
baseURL: model.baseUrl,
|
||||
dangerouslyAllowBrowser: true,
|
||||
defaultHeaders: mergeHeaders(
|
||||
|
||||
@@ -74,7 +74,12 @@ export async function resolveApiKey(provider: string): Promise<string | undefine
|
||||
}
|
||||
}
|
||||
|
||||
const result = await getOAuthApiKey(provider as OAuthProvider, oauthCredentials);
|
||||
let result: { newCredentials: OAuthCredentials; apiKey: string } | null = null;
|
||||
try {
|
||||
result = await getOAuthApiKey(provider as OAuthProvider, oauthCredentials);
|
||||
} catch (e) {
|
||||
console.log(JSON.stringify(e));
|
||||
}
|
||||
if (!result) return undefined;
|
||||
|
||||
// Save refreshed credentials back to auth.json
|
||||
|
||||
Reference in New Issue
Block a user