mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-05 16:04:43 +00:00
fix(usage): preserve migrated Go credential discovery
Follow the stored credential selection order so imported keys without an active flag remain discoverable, including when a legacy file is retained.
This commit is contained in:
@@ -58,7 +58,8 @@ export function readDatabaseLogin(path: string): DatabaseLogin | null {
|
||||
if (!tables.length) return null;
|
||||
const [value] = db
|
||||
.prepare(
|
||||
"SELECT value FROM credential WHERE integration_id = ? AND active = 1 ORDER BY time_updated DESC, id DESC LIMIT 1",
|
||||
// OpenCode also selects migrated rows with no active flag, ordered by creation time.
|
||||
"SELECT value FROM credential WHERE integration_id = ? ORDER BY active DESC, time_created DESC, id DESC LIMIT 1",
|
||||
)
|
||||
.all("opencode-go");
|
||||
const row = rowSchema.safeParse(value);
|
||||
|
||||
Reference in New Issue
Block a user