Skip to content

Commit

Permalink
fix: remove show password in auth list (#1061)
Browse files Browse the repository at this point in the history
Signed-off-by: Kay Yan <kay.yan@daocloud.io>
Co-authored-by: Aris Boutselis <arisboutselis08@gmail.com>
  • Loading branch information
yankay and arbreezy committed Apr 16, 2024
1 parent 9dfcce8 commit 9e02637
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions cmd/auth/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
)

var details bool
var userInput string

var listCmd = &cobra.Command{
Use: "list",
Expand All @@ -39,11 +38,6 @@ var listCmd = &cobra.Command{
os.Exit(1)
}

if details {
fmt.Println("Show password ? (y/n)")
fmt.Scan(&userInput)
}

// Print the default if it is set
fmt.Print(color.YellowString("Default: \n"))
if configAI.DefaultProvider != "" {
Expand All @@ -66,7 +60,7 @@ var listCmd = &cobra.Command{
if details {
for _, provider := range configAI.Providers {
if provider.Name == aiBackend {
printDetails(provider, userInput)
printDetails(provider)
}
}
}
Expand All @@ -91,7 +85,7 @@ func init() {
listCmd.Flags().BoolVar(&details, "details", false, "Print active provider configuration details")
}

func printDetails(provider ai.AIProvider, userInput string) {
func printDetails(provider ai.AIProvider) {
if provider.Model != "" {
fmt.Printf(" - Model: %s\n", provider.Model)
}
Expand Down

0 comments on commit 9e02637

Please sign in to comment.