Skip to content

Commit

Permalink
Removed clientID check and added const value
Browse files Browse the repository at this point in the history
  • Loading branch information
tirthct committed Jan 10, 2024
1 parent 2483caa commit 1576f84
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cmd/ocm/login/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const (
productionURL = "https://api.openshift.com"
stagingURL = "https://api.stage.openshift.com"
integrationURL = "https://api.integration.openshift.com"
oauthClientID = "cloud-services"
)

// When the value of the `--url` option is one of the keys of this map it will be replaced by the
Expand Down Expand Up @@ -163,13 +164,10 @@ func run(cmd *cobra.Command, argv []string) error {
}

if args.oauthLogin {
if args.clientID == "" {
return fmt.Errorf("Option '--client-id' is mandatory")
}
fmt.Println("You will now be redirected to Red Hat SSO login")
token, err := authentication.VerifyLogin(args.clientID)
token, err := authentication.VerifyLogin(oauthClientID)
if err != nil {
return fmt.Errorf(err.Error())
return err
}
args.token = token
}
Expand Down

0 comments on commit 1576f84

Please sign in to comment.