| @@ -12,19 +12,21 @@ import ( · 11 unmodified lines |
| 12 | 12 | // CredentialFileName returns the filename used to persist Codex OAuth credentials. |
| 13 | 13 | // When planType is available (e.g. "plus", "team"), it is appended after the email |
| 14 | 14 | // as a suffix to disambiguate subscriptions. |
| 15 | | −func CredentialFileName(email, planType string, includeProviderPrefix bool) string { |
| 15 | +func CredentialFileName(email, planType, hashAccountID string, includeProviderPrefix bool) string { |
| 16 | 16 | email = strings.TrimSpace(email) |
| 17 | 17 | plan := normalizePlanTypeForFilename(planType) |
| 18 | 18 | |
| 19 | 19 | prefix := "" |
| 20 | 20 | if includeProviderPrefix { |
| 21 | | − prefix = "codex-" |
| 21 | + prefix = "codex" |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | if plan == "" { |
| 25 | | − return fmt.Sprintf("%s%s.json", prefix, email) |
| 25 | + return fmt.Sprintf("%s-%s.json", prefix, email) |
| 26 | + } else if plan == "team" { |
| 27 | + return fmt.Sprintf("%s-%s-%s-%s.json", prefix, hashAccountID, email, plan) |
| 26 | 28 | } |
| 27 | | − return fmt.Sprintf("%s%s-%s.json", prefix, email, plan) |
| 29 | + return fmt.Sprintf("%s-%s-%s.json", prefix, email, plan) |
| 28 | 30 | } |
| 29 | 31 | |
| 30 | 32 | func normalizePlanTypeForFilename(planType string) string { |