diff --git a/cmd/cmd.go b/cmd/cmd.go index b0c7a8310..ac28286a7 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -69,7 +69,7 @@ func validateUserConfig(cfg *viper.Viper) error { if cfg.GetString("token") == "" { return fmt.Errorf( msgWelcomePleaseConfigure, - config.SettingsURL(cfg.GetString("apibaseurl")), + config.TokenURL(cfg.GetString("apibaseurl")), BinaryName, ) } diff --git a/cmd/configure.go b/cmd/configure.go index dd1c47ed8..57aabc04c 100644 --- a/cmd/configure.go +++ b/cmd/configure.go @@ -60,7 +60,7 @@ func runConfigure(configuration config.Config, flags *pflag.FlagSet) error { // If the command is run 'bare' and we have no token, // explain how to set the token. if flags.NFlag() == 0 && cfg.GetString("token") == "" { - tokenURL := config.SettingsURL(cfg.GetString("apibaseurl")) + tokenURL := config.TokenURL(cfg.GetString("apibaseurl")) return fmt.Errorf("There is no token configured. Find your token on %s, and call this command again with --token=.", tokenURL) } @@ -107,7 +107,7 @@ func runConfigure(configuration config.Config, flags *pflag.FlagSet) error { token = cfg.GetString("token") } - tokenURL := config.SettingsURL(cfg.GetString("apibaseurl")) + tokenURL := config.TokenURL(cfg.GetString("apibaseurl")) // If we don't have a token then explain how to set it and bail. if token == "" { diff --git a/cmd/troubleshoot.go b/cmd/troubleshoot.go index 2c599d6d5..f83d5cc96 100644 --- a/cmd/troubleshoot.go +++ b/cmd/troubleshoot.go @@ -191,7 +191,7 @@ func newConfigurationStatus(status *Status) configurationStatus { Workspace: workspace, Dir: status.cfg.Dir, Token: v.GetString("token"), - TokenURL: config.SettingsURL(v.GetString("apibaseurl")), + TokenURL: config.TokenURL(v.GetString("apibaseurl")), } if status.Censor && cs.Token != "" { cs.Token = debug.Redact(cs.Token) diff --git a/config/config.go b/config/config.go index e1cc37e08..d52e3fd97 100644 --- a/config/config.go +++ b/config/config.go @@ -128,7 +128,7 @@ func InferSiteURL(apiURL string) string { return re.ReplaceAllString(apiURL, "$1") } -// SettingsURL provides a link to where the user can find their API token. -func SettingsURL(apiURL string) string { - return fmt.Sprintf("%s%s", InferSiteURL(apiURL), "/my/settings") +// TokenURL provides a link to where the user can find their API token. +func TokenURL(apiURL string) string { + return fmt.Sprintf("%s%s", InferSiteURL(apiURL), "/my/settings/api_cli") }