fix: normalizeKey doesn't add :default suffix

When no profile is provided, normalizeKey now returns the base providerID
without appending ':default'. This ensures backward compatibility - existing
auth.json entries with bare provider keys work correctly.
pull/21353/head
PabloGNU 2026-04-07 16:11:12 +02:00
parent 5e904080f4
commit 3d62e43ab5
1 changed files with 2 additions and 2 deletions

View File

@ -13,9 +13,9 @@ const fail = (message: string) => (cause: unknown) => new Auth.AuthError({ messa
const normalizeKey = (providerID: string, profile?: string): string => {
const base = providerID.replace(/\/+$/, "")
// If key already contains a profile separator and no profile arg provided, treat as already normalized
// If key already contains a profile separator, treat as already normalized
if (!profile && base.includes(":")) return base
return profile ? `${base}:${profile}` : `${base}:default`
return profile ? `${base}:${profile}` : base
}
export namespace Auth {