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

Limit user creation to database connections #336

Merged
merged 2 commits into from
Jul 15, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion docs/auth0_users_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ auth0 users create -n "John Doe" --e [email protected] --connection "Username-Pas
### Options

```
-c, --connection string Name of the connection this user should be created in. Social connections are not supported.
-c, --connection string Name of the database connection this user should be created in.
-e, --email string The user's email.
-h, --help help for create
-n, --name string The user's full name.
Expand Down
2 changes: 1 addition & 1 deletion docs/auth0_users_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ auth0 users update -n John Doe --email [email protected]
### Options

```
-c, --connection string Name of the connection this user should be created in. Social connections are not supported.
-c, --connection string Name of the database connection this user should be created in.
-e, --email string The user's email.
-h, --help help for update
-n, --name string The user's full name.
Expand Down
7 changes: 5 additions & 2 deletions internal/cli/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ var (
Name: "User ID",
Help: "Id of the user.",
}

userConnection = Flag{
Name: "Connection",
LongForm: "connection",
ShortForm: "c",
Help: "Name of the connection this user should be created in. Social connections are not supported.",
Help: "Name of the database connection this user should be created in.",
IsRequired: true,
}
userEmail = Flag{
Expand Down Expand Up @@ -548,7 +549,9 @@ func (c *cli) connectionPickerOptions() []string {
fmt.Println(err)
}
for _, conn := range list.Connections {
res = append(res, conn.GetName())
if conn.GetStrategy() == "auth0" {
res = append(res, conn.GetName())
}
}

return res
Expand Down