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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user