Skip to content

Commit

Permalink
chore: handle errors on login/save profile and also persist profile
Browse files Browse the repository at this point in the history
  • Loading branch information
leggetter committed Aug 20, 2024
1 parent aa6dbd9 commit fb612d9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/login/client_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ func Login(config *config.Config, input io.Reader) error {
message := SuccessMessage(response.UserName, response.UserEmail, response.OrganizationName, response.TeamName, response.TeamMode == "console")
ansi.StopSpinner(s, message, os.Stdout)

config.Profile.SaveProfile(config.LocalConfigFile != "")
if err = config.Profile.SaveProfile(false); err != nil {
return err
}
if err = config.Profile.UseProfile(); err != nil {
return err
}

return nil
}
Expand Down

0 comments on commit fb612d9

Please sign in to comment.