mirror of
https://github.com/zitadel/zitadel.git
synced 2025-02-28 21:17:23 +00:00
fix: features and texts models (#2653)
This commit is contained in:
parent
5bc0520adb
commit
7324e776cf
@ -22,7 +22,7 @@ func (wm *CustomLoginTextsReadModel) Reduce() error {
|
||||
wm.CustomLoginTexts[e.Template+e.Language.String()] = &CustomText{Language: e.Language, Template: e.Template}
|
||||
case *policy.CustomTextTemplateRemovedEvent:
|
||||
if _, ok := wm.CustomLoginTexts[e.Template+e.Language.String()]; ok {
|
||||
delete(wm.CustomLoginTexts, e.Template)
|
||||
delete(wm.CustomLoginTexts, e.Template+e.Language.String())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ func (wm *CustomMessageTemplatesReadModel) Reduce() error {
|
||||
}
|
||||
case *policy.CustomTextTemplateRemovedEvent:
|
||||
if _, ok := wm.CustomMessageTemplate[e.Template+e.Language.String()]; ok {
|
||||
delete(wm.CustomMessageTemplate, e.Template)
|
||||
delete(wm.CustomMessageTemplate, e.Template+e.Language.String())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -87,6 +87,9 @@ func (wm *FeaturesWriteModel) Reduce() error {
|
||||
if e.CustomDomain != nil {
|
||||
wm.CustomDomain = *e.CustomDomain
|
||||
}
|
||||
if e.PrivacyPolicy != nil {
|
||||
wm.PrivacyPolicy = *e.PrivacyPolicy
|
||||
}
|
||||
if e.MetadataUser != nil {
|
||||
wm.MetadataUser = *e.MetadataUser
|
||||
}
|
||||
|
@ -185,9 +185,16 @@ func writeModelToFeatures(wm *FeaturesWriteModel) *domain.Features {
|
||||
LoginPolicyPasswordless: wm.LoginPolicyPasswordless,
|
||||
LoginPolicyRegistration: wm.LoginPolicyRegistration,
|
||||
LoginPolicyUsernameLogin: wm.LoginPolicyUsernameLogin,
|
||||
LoginPolicyPasswordReset: wm.LoginPolicyPasswordReset,
|
||||
PasswordComplexityPolicy: wm.PasswordComplexityPolicy,
|
||||
LabelPolicyPrivateLabel: wm.LabelPolicyPrivateLabel,
|
||||
LabelPolicyWatermark: wm.LabelPolicyWatermark,
|
||||
CustomDomain: wm.CustomDomain,
|
||||
PrivacyPolicy: wm.PrivacyPolicy,
|
||||
MetadataUser: wm.MetadataUser,
|
||||
CustomTextMessage: wm.CustomTextMessage,
|
||||
CustomTextLogin: wm.CustomTextLogin,
|
||||
LockoutPolicy: wm.LockoutPolicy,
|
||||
Actions: wm.Actions,
|
||||
}
|
||||
}
|
||||
|
@ -45,6 +45,7 @@ func (c *Commands) setDefaultFeatures(ctx context.Context, existingFeatures *IAM
|
||||
features.LoginPolicyPasswordless,
|
||||
features.LoginPolicyRegistration,
|
||||
features.LoginPolicyUsernameLogin,
|
||||
features.LoginPolicyPasswordReset,
|
||||
features.PasswordComplexityPolicy,
|
||||
features.LabelPolicyPrivateLabel,
|
||||
features.LabelPolicyWatermark,
|
||||
|
@ -63,6 +63,7 @@ func (wm *IAMFeaturesWriteModel) NewSetEvent(
|
||||
loginPolicyPasswordless,
|
||||
loginPolicyRegistration,
|
||||
loginPolicyUsernameLogin,
|
||||
loginPolicyPasswordReset,
|
||||
passwordComplexityPolicy,
|
||||
labelPolicyPrivateLabel,
|
||||
labelPolicyWatermark,
|
||||
@ -107,6 +108,9 @@ func (wm *IAMFeaturesWriteModel) NewSetEvent(
|
||||
if wm.LoginPolicyUsernameLogin != loginPolicyUsernameLogin {
|
||||
changes = append(changes, features.ChangeLoginPolicyUsernameLogin(loginPolicyUsernameLogin))
|
||||
}
|
||||
if wm.LoginPolicyPasswordReset != loginPolicyPasswordReset {
|
||||
changes = append(changes, features.ChangeLoginPolicyPasswordReset(loginPolicyPasswordReset))
|
||||
}
|
||||
if wm.PasswordComplexityPolicy != passwordComplexityPolicy {
|
||||
changes = append(changes, features.ChangePasswordComplexityPolicy(passwordComplexityPolicy))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user