hkfires commited on
Commit ·
047a801
1
Parent(s): 826eae2
fix(auth): normalize plan type filenames to lowercase
Browse files
internal/auth/codex/filename.go
CHANGED
|
@@ -4,9 +4,6 @@ import (
|
|
| 4 |
"fmt"
|
| 5 |
"strings"
|
| 6 |
"unicode"
|
| 7 |
-
|
| 8 |
-
"golang.org/x/text/cases"
|
| 9 |
-
"golang.org/x/text/language"
|
| 10 |
)
|
| 11 |
|
| 12 |
// CredentialFileName returns the filename used to persist Codex OAuth credentials.
|
|
@@ -43,15 +40,7 @@ func normalizePlanTypeForFilename(planType string) string {
|
|
| 43 |
}
|
| 44 |
|
| 45 |
for i, part := range parts {
|
| 46 |
-
parts[i] =
|
| 47 |
}
|
| 48 |
return strings.Join(parts, "-")
|
| 49 |
}
|
| 50 |
-
|
| 51 |
-
func titleToken(token string) string {
|
| 52 |
-
token = strings.TrimSpace(token)
|
| 53 |
-
if token == "" {
|
| 54 |
-
return ""
|
| 55 |
-
}
|
| 56 |
-
return cases.Title(language.English).String(token)
|
| 57 |
-
}
|
|
|
|
| 4 |
"fmt"
|
| 5 |
"strings"
|
| 6 |
"unicode"
|
|
|
|
|
|
|
|
|
|
| 7 |
)
|
| 8 |
|
| 9 |
// CredentialFileName returns the filename used to persist Codex OAuth credentials.
|
|
|
|
| 40 |
}
|
| 41 |
|
| 42 |
for i, part := range parts {
|
| 43 |
+
parts[i] = strings.ToLower(strings.TrimSpace(part))
|
| 44 |
}
|
| 45 |
return strings.Join(parts, "-")
|
| 46 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|