Skip to content

Commit

Permalink
[CLOUDTRUST-2247] User must be enabled to send execute actions emails
Browse files Browse the repository at this point in the history
  • Loading branch information
harture committed Jan 29, 2020
1 parent 47cd1ca commit 31b8169
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion api/register/api.go
Expand Up @@ -86,6 +86,7 @@ func (u *User) UserToJSON() string {
// UpdateUserRepresentation converts a given User to a Keycloak UserRepresentation
func (u *User) UpdateUserRepresentation(kcUser *kc.UserRepresentation) {
var (
bTrue = true
bFalse = false
attributes = make(map[string][]string)
)
Expand All @@ -103,7 +104,7 @@ func (u *User) UpdateUserRepresentation(kcUser *kc.UserRepresentation) {

kcUser.Email = u.EmailAddress
kcUser.EmailVerified = &bFalse
kcUser.Enabled = &bFalse
kcUser.Enabled = &bTrue
kcUser.FirstName = u.FirstName
kcUser.LastName = u.LastName
kcUser.Attributes = &attributes
Expand Down
2 changes: 1 addition & 1 deletion api/register/api_test.go
Expand Up @@ -59,7 +59,7 @@ func TestToKeycloakUser(t *testing.T) {
assert.Equal(t, user.LastName, kcUser.LastName)
assert.Equal(t, user.EmailAddress, kcUser.Email)
assert.False(t, *kcUser.EmailVerified)
assert.False(t, *kcUser.Enabled)
assert.True(t, *kcUser.Enabled)
}

func TestValidateParameterIn(t *testing.T) {
Expand Down

0 comments on commit 31b8169

Please sign in to comment.