feat: Lockout policy feature (#2341)

* feat: add lockoutpolicy feature

* feat: add tests

* fix: err handling
This commit is contained in:
Fabi
2021-09-09 15:42:28 +02:00
committed by GitHub
parent 257bf90f7e
commit 59e393728e
20 changed files with 165 additions and 8 deletions

View File

@@ -39,6 +39,7 @@ type FeaturesSetEvent struct {
MetadataUser *bool `json:"metadataUser,omitempty"`
CustomTextMessage *bool `json:"customTextMessage,omitempty"`
CustomTextLogin *bool `json:"customTextLogin,omitempty"`
LockoutPolicy *bool `json:"lockoutPolicy,omitempty"`
}
func (e *FeaturesSetEvent) Data() interface{} {
@@ -181,6 +182,12 @@ func ChangeCustomTextLogin(customTextLogin bool) func(event *FeaturesSetEvent) {
}
}
func ChangeLockoutPolicy(lockoutPolicy bool) func(event *FeaturesSetEvent) {
return func(e *FeaturesSetEvent) {
e.LockoutPolicy = &lockoutPolicy
}
}
func FeaturesSetEventMapper(event *repository.Event) (eventstore.EventReader, error) {
e := &FeaturesSetEvent{
BaseEvent: *eventstore.BaseEventFromRepo(event),