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

Conversation

cyx
Copy link
Contributor

@cyx cyx commented Feb 5, 2022

Description

For the blank slate case, we don't want it to error out if there are no
tenants since by definition we have no tenants configured.

References

#392

Testing

  1. Remove all your config e.g. rm -rf ~/.config/auth0
  2. Try doing auth0 tenants add

You should be prompted, instead of seeing an error.

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not master

For the blank slate case, we don't want it to error out if there are no
tenants since by definition we have no tenants configured.
Comment on lines +170 to +172
if !errors.Is(err, errUnauthenticated) {
return err
}
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.

Comment on lines +174 to +176
if err := tenantDomain.Ask(cmd, &inputs.Domain); err != nil {
return err
}
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.

Copy link
Contributor

@Widcket Widcket left a comment

Choose a reason for hiding this comment

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

Thank you!

@Widcket Widcket merged commit 1e46739 into main Feb 5, 2022
@Widcket Widcket deleted the fix-tenants-add-blankslate branch February 5, 2022 01:04
tylernix pushed a commit that referenced this pull request Mar 17, 2022
For the blank slate case, we don't want it to error out if there are no
tenants since by definition we have no tenants configured.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants