Skip to content

Commit

Permalink
Cleanup getLogin in helper template
Browse files Browse the repository at this point in the history
  • Loading branch information
cyx committed Jan 23, 2021
1 parent 8b3ae5f commit a201cf3
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions internal/cli/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"strings"

"github.com/auth0/auth0-cli/internal/ansi"
"github.com/spf13/afero"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"golang.org/x/crypto/ssh/terminal"
Expand Down Expand Up @@ -73,25 +72,13 @@ func WrappedNonRequestParamsFlagUsages(cmd *cobra.Command) string {
// Private functions
//

func getLogin(fs *afero.Fs, cli *cli) string {
// // We're checking against the path because we don't initialize the config
// // at this point of execution.
// path := cfg.GetConfigFolder(os.Getenv("XDG_CONFIG_HOME"))
// file := filepath.Join(path, "config.toml")

// exists, _ := afero.Exists(*fs, file)

exists := false
if !exists {
return `
func getLogin(cli *cli) string {
if !cli.isLoggedIn() {
return ansi.Italic(`
Before using the CLI, you'll need to login:
$ auth0 login
If you're working with multiple tenants, you can run
the login command with the --tenant and --region flag:
$ auth0 login --tenant travel0 --region us`
`)
}

return ""
Expand Down

0 comments on commit a201cf3

Please sign in to comment.