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
parent
5e904080f4
commit
3d62e43ab5
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue