Skip to content

Commit

Permalink
Fix the failing auth login command due to missing credentials (#5031)
Browse files Browse the repository at this point in the history
Fix the auth login command failing due to missing credentials

Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
  • Loading branch information
rdimitrov authored Nov 25, 2024
1 parent a3fbb21 commit 613030b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/cli/app/auth/auth_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ $XDG_CONFIG_HOME/minder/credentials.json`,
}

// LoginCommand is the login subcommand
func LoginCommand(ctx context.Context, cmd *cobra.Command, _ []string, conn *grpc.ClientConn) error {
func LoginCommand(ctx context.Context, cmd *cobra.Command, _ []string, _ *grpc.ClientConn) error {
clientConfig, err := config.ReadConfigFromViper[clientconfig.Config](viper.GetViper())
if err != nil {
return cli.MessageAndError("Unable to read config", err)
Expand All @@ -40,6 +40,13 @@ func LoginCommand(ctx context.Context, cmd *cobra.Command, _ []string, conn *grp
return cli.MessageAndError("Error ensuring credentials", err)
}

// Get a connection to the GRPC server after we have the credentials
conn, err := cli.GrpcForCommand(cmd, viper.GetViper())
if err != nil {
return err
}
defer conn.Close()

client := minderv1.NewUserServiceClient(conn)

// check if the user already exists in the local database
Expand Down

0 comments on commit 613030b

Please sign in to comment.