Skip to content

Commit

Permalink
Fix the API Token generation URL in API token prompt
Browse files Browse the repository at this point in the history
Signed-off-by: Prem Kumar Kalle <[email protected]>
  • Loading branch information
prkalle committed Sep 13, 2024
1 parent 2dede77 commit fd1bf73
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/command/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -1015,13 +1015,14 @@ func promptContextName(defaultCtxName string) (cname string, err error) {

// Interactive way to create a TMC context. User will be prompted for CSP API token.
func promptAPIToken(endpointType string) (apiToken string, err error) {
hostVal := "console.cloud.vmware.com"
if staging {
hostVal = "console-stg.cloud.vmware.com"
issuer := csp.GetIssuer(staging)
u, err := url.ParseRequestURI(issuer)
if err != nil {
return "", errors.Wrap(err, "failed to parse the issuer URL")
}
consoleURL := url.URL{
Scheme: "https",
Host: hostVal,
Host: u.Hostname(),
Path: "/csp/gateway/portal/",
Fragment: "/user/tokens",
}
Expand Down

0 comments on commit fd1bf73

Please sign in to comment.