Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: auth0 tenants add: blank slate #394

Merged
merged 1 commit into from
Feb 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion internal/cli/tenants.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cli

import (
"errors"
"fmt"

"github.com/auth0/auth0-cli/internal/prompt"
Expand Down Expand Up @@ -166,7 +167,13 @@ func addTenantCmd(cli *cli) *cobra.Command {
if len(args) == 0 {
err := tenantDomain.Pick(cmd, &inputs.Domain, cli.tenantPickerOptions)
if err != nil {
return err
if !errors.Is(err, errUnauthenticated) {
return err
}
Comment on lines +170 to +172
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the event we get a different type of error we won't silence it accidentally. For this case, we only care about errUnauthenticated.


if err := tenantDomain.Ask(cmd, &inputs.Domain); err != nil {
return err
}
Comment on lines +174 to +176
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We revert to a basic prompt since there's no "list" of tenants yet to formulate / present.

}
} else {
inputs.Domain = args[0]
Expand Down