fix: apply default auth-dir when config value is empty

When auth-dir is not specified in config.yaml, ResolveAuthDir returns
an empty string which causes os.MkdirAll to fail with no path. Use
the documented default ~/.cli-proxy-api instead.

Fixes #3272
This commit is contained in:
lihan3238
2026-05-08 21:47:41 +08:00
parent 785b00c312
commit 4071fdef84
+1 -1
View File
@@ -75,7 +75,7 @@ func SetLogLevel(cfg *config.Config) {
// It expands a leading tilde (~) to the user's home directory and returns a cleaned path.
func ResolveAuthDir(authDir string) (string, error) {
if authDir == "" {
return "", nil
authDir = "~/.cli-proxy-api"
}
if strings.HasPrefix(authDir, "~") {
home, err := os.UserHomeDir()