From eefcfd8440465dc5087e268d8402a1803f8495a1 Mon Sep 17 00:00:00 2001 From: Yang Luo Date: Fri, 27 Aug 2021 23:43:43 +0800 Subject: [PATCH] Fix address null bug. --- controllers/auth.go | 1 + object/user_test.go | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/controllers/auth.go b/controllers/auth.go index 7c812b62..cbfa19d2 100644 --- a/controllers/auth.go +++ b/controllers/auth.go @@ -293,6 +293,7 @@ func (c *ApiController) Login() { Type: "normal-user", DisplayName: userInfo.DisplayName, Avatar: userInfo.AvatarUrl, + Address: []string{}, Email: userInfo.Email, Score: score, IsAdmin: false, diff --git a/object/user_test.go b/object/user_test.go index 5364d292..9f85d6cb 100644 --- a/object/user_test.go +++ b/object/user_test.go @@ -91,8 +91,8 @@ func TestGetMaskedUsers(t *testing.T) { }{ { name: "1", - args: args{users: []*User{{Password: "casdoor"},{Password: "casbin"}}}, - want: []*User{{Password: "***"},{Password: "***"}}, + args: args{users: []*User{{Password: "casdoor"}, {Password: "casbin"}}}, + want: []*User{{Password: "***"}, {Password: "***"}}, }, } for _, tt := range tests { @@ -102,4 +102,4 @@ func TestGetMaskedUsers(t *testing.T) { } }) } -} \ No newline at end of file +}