mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-24 03:26:45 +00:00
fix: ensure event order in setDefaultAuthFactorsInCustomLoginPolicy (for testability) (#1595)
* fix: ensure event order (for testability) * fix: error handling (incl. imports of wrong pkgs)
This commit is contained in:
@@ -168,8 +168,9 @@ func (c *Commands) setDefaultAuthFactorsInCustomLoginPolicy(ctx context.Context,
|
||||
return nil, err
|
||||
}
|
||||
events := make([]eventstore.EventPusher, 0)
|
||||
for factor, state := range orgAuthFactors.SecondFactors {
|
||||
if state.IAM == state.Org {
|
||||
for _, factor := range domain.SecondFactorTypes() {
|
||||
state := orgAuthFactors.SecondFactors[factor]
|
||||
if state == nil || state.IAM == state.Org {
|
||||
continue
|
||||
}
|
||||
secondFactorWriteModel := orgAuthFactors.ToSecondFactorWriteModel(factor)
|
||||
@@ -191,8 +192,10 @@ func (c *Commands) setDefaultAuthFactorsInCustomLoginPolicy(ctx context.Context,
|
||||
events = append(events, event)
|
||||
}
|
||||
}
|
||||
for factor, state := range orgAuthFactors.MultiFactors {
|
||||
if state.IAM == state.Org {
|
||||
|
||||
for _, factor := range domain.MultiFactorTypes() {
|
||||
state := orgAuthFactors.MultiFactors[factor]
|
||||
if state == nil || state.IAM == state.Org {
|
||||
continue
|
||||
}
|
||||
multiFactorWriteModel := orgAuthFactors.ToMultiFactorWriteModel(factor)
|
||||
|
||||
Reference in New Issue
Block a user