mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-28 06:58:54 +00:00
feat: rt recovery code check (#11848)
# Which Problems Are Solved Adding recovery code check step required for the CreateSession RT implementation. # How the Problems Are Solved - Introduce `RecoveryCodeCheckCommand` (validate/execute/events) for session creation checks - Add unit tests # Additional Changes - refactor password-check code to reuse a shared lockout-policy helper - add some missing error translations in `internal/static/i18n/en.yaml` # Additional Context - Related to https://github.com/zitadel/zitadel/issues/11035 --------- Co-authored-by: Silvan <[email protected]> Co-authored-by: Copilot Autofix powered by AI <[email protected]>
This commit is contained in:
co-authored by
Silvan
Copilot Autofix powered by AI
parent
471ed4a5d7
commit
c6386cb807
@@ -114,6 +114,9 @@ func generateAlphanumericCode(length int, withHyphen bool) (string, error) {
|
||||
return code, nil
|
||||
}
|
||||
|
||||
// ValidateRecoveryCode validates the input code against the saved recovery codes of a user.
|
||||
// The validation logic is also implemented in backend/v3/domain/session_check_recovery_code.go.
|
||||
// Keep both implementations in sync until this duplication is removed.
|
||||
func ValidateRecoveryCode(ctx context.Context, code string, recoveryCodes *HumanRecoveryCodes, hasher *crypto.Hasher) (_ string, err error) {
|
||||
ctx, span := tracing.NewSpan(ctx)
|
||||
defer func() { span.EndWithError(err) }()
|
||||
|
||||
Reference in New Issue
Block a user