Skip to content

Commit

Permalink
Added descriptive message in flag and changed error message for bette…
Browse files Browse the repository at this point in the history
…r understanding
  • Loading branch information
tirthct committed Jan 18, 2024
1 parent cdb643d commit f96af1a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/ocm/login/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ func init() {
&args.useAuthCode,
"use-auth-code",
false,
"Enables login using OAuth2, Redirects user to Red Hat SSO.",
"Enables OAuth Authorization Code login using PKCE. If this option is provided, "+
"the user will be taken to Red Hat SSO for authentication. In order to use a different account"+
"log out from sso.redhat.com after using the 'ocm logout' command.",
)
flags.MarkHidden("use-auth-code")
}
Expand All @@ -167,7 +169,7 @@ func run(cmd *cobra.Command, argv []string) error {
fmt.Println("You will now be redirected to Red Hat SSO login")
token, err := authentication.VerifyLogin(oauthClientID)
if err != nil {
return err
return fmt.Errorf("An error occurred while retrieving the token : %v", err)
}
args.token = token
fmt.Println("Token received successfully")
Expand Down

0 comments on commit f96af1a

Please sign in to comment.