diff --git a/src/lib/db/providers.ts b/src/lib/db/providers.ts index c6472a6f4e..4cad15fffd 100644 --- a/src/lib/db/providers.ts +++ b/src/lib/db/providers.ts @@ -51,15 +51,6 @@ export async function createProviderConnection(data: any) { "SELECT * FROM provider_connections WHERE provider = ? AND auth_type = 'oauth' AND email = ?" ) .get(data.provider, data.email); - } else if (data.authType === "oauth" && !data.email) { - // Fallback for providers that don't return email (e.g. Codex, Qwen): - // find the most recently updated connection for this provider to update instead of duplicating - existing = db - .prepare( - `SELECT * FROM provider_connections WHERE provider = ? AND auth_type = 'oauth' - ORDER BY updated_at DESC LIMIT 1` - ) - .get(data.provider); } else if (data.authType === "apikey" && data.name) { existing = db .prepare( diff --git a/src/lib/oauth/providers/qwen.ts b/src/lib/oauth/providers/qwen.ts index 0a31c09212..e942aa6faa 100644 --- a/src/lib/oauth/providers/qwen.ts +++ b/src/lib/oauth/providers/qwen.ts @@ -47,6 +47,7 @@ export const qwen = { }; }, mapTokens: (tokens) => { + console.log("QWEN RAW TOKENS:", JSON.stringify(tokens, null, 2)); let email = null; let displayName = null; if (tokens.id_token) {