diff --git a/utils/config.go b/utils/config.go index e8529f6af3..966dba347a 100644 --- a/utils/config.go +++ b/utils/config.go @@ -505,7 +505,6 @@ func GenerateClientConfig(c *model.Config, diagnosticId string, license *model.L props["LdapNicknameAttributeSet"] = "false" props["LdapFirstNameAttributeSet"] = "false" props["LdapLastNameAttributeSet"] = "false" - props["EnforceMultifactorAuthentication"] = "false" props["EnableCompliance"] = "false" props["EnableMobileFileDownload"] = "true" props["EnableMobileFileUpload"] = "true" @@ -675,6 +674,7 @@ func GenerateLimitedClientConfig(c *model.Config, diagnosticId string, license * props["CustomBrandText"] = *c.TeamSettings.CustomBrandText props["CustomDescriptionText"] = *c.TeamSettings.CustomDescriptionText props["EnableMultifactorAuthentication"] = strconv.FormatBool(*c.ServiceSettings.EnableMultifactorAuthentication) + props["EnforceMultifactorAuthentication"] = "false" if license != nil { if *license.Features.LDAP { diff --git a/utils/config_test.go b/utils/config_test.go index 74b886e36c..5dec73b549 100644 --- a/utils/config_test.go +++ b/utils/config_test.go @@ -487,9 +487,10 @@ func TestGetClientConfig(t *testing.T) { "", nil, map[string]string{ - "DiagnosticId": "", - "EmailNotificationContentsType": "full", - "AllowCustomThemes": "true", + "DiagnosticId": "", + "EmailNotificationContentsType": "full", + "AllowCustomThemes": "true", + "EnforceMultifactorAuthentication": "false", }, }, { @@ -537,6 +538,23 @@ func TestGetClientConfig(t *testing.T) { "AllowCustomThemes": "false", }, }, + { + "licensed for enforcement", + &model.Config{ + ServiceSettings: model.ServiceSettings{ + EnforceMultifactorAuthentication: bToP(true), + }, + }, + "tag1", + &model.License{ + Features: &model.Features{ + MFA: bToP(true), + }, + }, + map[string]string{ + "EnforceMultifactorAuthentication": "true", + }, + }, } for _, testCase := range testCases {