summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api4/user_test.go8
-rw-r--r--model/user.go1
2 files changed, 7 insertions, 2 deletions
diff --git a/api4/user_test.go b/api4/user_test.go
index 1f408048e..59057f347 100644
--- a/api4/user_test.go
+++ b/api4/user_test.go
@@ -355,6 +355,9 @@ func TestGetUser(t *testing.T) {
Client := th.Client
user := th.CreateUser()
+ user.Props = map[string]string{"testpropkey": "testpropvalue"}
+
+ th.App.UpdateUser(user, false)
ruser, resp := Client.GetUser(user.Id, "")
CheckNoError(t, resp)
@@ -364,6 +367,9 @@ func TestGetUser(t *testing.T) {
t.Fatal("emails did not match")
}
+ assert.NotNil(t, ruser.Props)
+ assert.Equal(t, ruser.Props["testpropkey"], "testpropvalue")
+
ruser, resp = Client.GetUser(user.Id, resp.Etag)
CheckEtag(t, ruser, resp)
@@ -2447,7 +2453,7 @@ func TestRevokeUserAccessToken(t *testing.T) {
if !ok {
t.Fatal("should have passed")
}
-
+
oldSessionToken = Client.AuthToken
Client.AuthToken = token.Token
_, resp = Client.GetMe("")
diff --git a/model/user.go b/model/user.go
index ab4b21e23..8a2c5930c 100644
--- a/model/user.go
+++ b/model/user.go
@@ -346,7 +346,6 @@ func (u *User) ClearNonProfileFields() {
u.MfaSecret = ""
u.EmailVerified = false
u.AllowMarketing = false
- u.Props = StringMap{}
u.NotifyProps = StringMap{}
u.LastPasswordUpdate = 0
u.FailedAttempts = 0