mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-12 02:02:13 +03:00
fix(db): remove OAuth fallback overwrite when email is missing to natively support multiple accounts
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user