Skip to content
This repository was archived by the owner on Mar 8, 2022. It is now read-only.

Commit de28ad6

Browse files
author
alexkalyvitis
committed
Merge branch 'tkeber-master'
2 parents 2d6a6ef + c22a76c commit de28ad6

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

auth0/resource_auth0_user.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ func newUser() *schema.Resource {
3939
Type: schema.TypeString,
4040
Optional: true,
4141
},
42+
"nickname": {
43+
Type: schema.TypeString,
44+
Optional: true,
45+
},
4246
"password": {
4347
Type: schema.TypeString,
4448
Optional: true,
@@ -82,6 +86,7 @@ func readUser(d *schema.ResourceData, m interface{}) error {
8286

8387
d.Set("user_id", u.ID)
8488
d.Set("username", u.Username)
89+
d.Set("nickname", u.Nickname)
8590
d.Set("phone_number", u.PhoneNumber)
8691
d.Set("email_verified", u.EmailVerified)
8792
d.Set("phone_verified", u.PhoneVerified)
@@ -128,6 +133,7 @@ func buildUser(d *schema.ResourceData) *management.User {
128133
ID: String(d, "user_id"),
129134
Connection: String(d, "connection_name"),
130135
Username: String(d, "username"),
136+
Nickname: String(d, "nickname"),
131137
PhoneNumber: String(d, "phone_number"),
132138
EmailVerified: Bool(d, "email_verified"),
133139
VerifyEmail: Bool(d, "verify_email"),

auth0/resource_auth0_user_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ func TestAccUserCreateUser(t *testing.T) {
4040
Check: resource.ComposeTestCheckFunc(
4141
resource.TestCheckResourceAttr("auth0_user.user", "user_id", "12345"),
4242
resource.TestCheckResourceAttr("auth0_user.user", "email", "[email protected]"),
43+
resource.TestCheckResourceAttr("auth0_user.user", "nickname", "testnick"),
4344
resource.TestCheckResourceAttr("auth0_user.user", "connection_name", "Username-Password-Authentication"),
4445
),
4546
},
@@ -52,9 +53,11 @@ provider "auth0" {}
5253
5354
resource "auth0_user" "user" {
5455
connection_name = "Username-Password-Authentication"
56+
username = "test"
5557
user_id = "12345"
5658
57-
password = "testtest$12$12"
59+
password = "passpass$12$12"
60+
nickname = "testnick"
5861
user_metadata = <<EOF
5962
{
6063
"foo": "bar",

example/user/main.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ provider "auth0" {}
33
resource "auth0_user" "user" {
44
connection_name = "Username-Password-Authentication"
55
user_id = "12345"
6+
username = "test"
7+
nickname = "testnick"
68
79
email_verified = true
8-
password = "testtest$12$12"
10+
password = "passpass$12$12"
911
}

0 commit comments

Comments
 (0)