mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-21 12:28:46 +00:00
feat: rt sessions OTP email challenge (#11941)
# Which Problems Are Solved Add OTP Email challenge needed for Create/Set session in the RT model. # How the Problems Are Solved Introduce `OTPEmailChallengeCommand` (validate/execute/events) for session creation checks Add unit tests # Additional Changes Remove unused fields from `session_challenge_otp_sms.go` # Additional Context - Related to https://github.com/zitadel/zitadel/issues/11035 --------- Co-authored-by: Marco A. <[email protected]>
This commit is contained in:
co-authored by
Marco A.
parent
9bab764796
commit
7c3d26b23b
@@ -1320,17 +1320,11 @@ func updateHumanUserFailedExpectation(ctrl *gomock.Controller, userRepo *domainm
|
||||
userUpdates = append(userUpdates, humanRepo.SetState(domain.UserStateLocked))
|
||||
}
|
||||
userRepo.EXPECT().Human().Times(1).Return(humanRepo)
|
||||
if err != nil {
|
||||
humanRepo.EXPECT().
|
||||
Update(gomock.Any(), gomock.Any(), primaryKeyCondition, userUpdates).
|
||||
Times(1).
|
||||
Return(int64(0), err)
|
||||
return
|
||||
}
|
||||
|
||||
humanRepo.EXPECT().
|
||||
Update(gomock.Any(), gomock.Any(), primaryKeyCondition, userUpdates).
|
||||
Times(1).
|
||||
Return(updateCount, nil)
|
||||
Return(updateCount, err)
|
||||
}
|
||||
|
||||
func getUserSucceededExpectation(userRepo *domainmock.UserRepo, failedAttempts uint8) {
|
||||
@@ -1363,17 +1357,10 @@ func updateSessionSucceededExpectation(sessionRepo *domainmock.SessionRepo, chan
|
||||
|
||||
func updateSessionFailedExpectation(sessionRepo *domainmock.SessionRepo, change database.Change, err error, updateCount int64) {
|
||||
primaryKeyCondition := sessionRepo.PrimaryKeyCondition("instance-1", "session-1")
|
||||
if err != nil {
|
||||
sessionRepo.EXPECT().
|
||||
Update(gomock.Any(), gomock.Any(), primaryKeyCondition, change).
|
||||
Times(1).
|
||||
Return(updateCount, err)
|
||||
return
|
||||
}
|
||||
sessionRepo.EXPECT().
|
||||
Update(gomock.Any(), gomock.Any(), primaryKeyCondition, change).
|
||||
Times(1).
|
||||
Return(updateCount, nil)
|
||||
Return(updateCount, err)
|
||||
}
|
||||
|
||||
func getSessionSucceededExpectation(sessionRepo *domainmock.SessionRepo) {
|
||||
|
||||
Reference in New Issue
Block a user