mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-15 04:18:01 +00:00
fix: correctly respect maxFailureCount (#7143)
This commit is contained in:
parent
5cbf34334f
commit
e6b87b622e
@ -4,11 +4,9 @@ import (
|
||||
"context"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/api/authz"
|
||||
"github.com/zitadel/zitadel/internal/eventstore/v1/models"
|
||||
"github.com/zitadel/zitadel/internal/query"
|
||||
usr_view "github.com/zitadel/zitadel/internal/user/repository/view"
|
||||
usr_view_model "github.com/zitadel/zitadel/internal/user/repository/view/model"
|
||||
"github.com/zitadel/zitadel/internal/zerrors"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -19,26 +17,6 @@ func (v *View) TokenByIDs(tokenID, userID, instanceID string) (*usr_view_model.T
|
||||
return usr_view.TokenByIDs(v.Db, tokenTable, tokenID, userID, instanceID)
|
||||
}
|
||||
|
||||
func (v *View) PutToken(token *usr_view_model.TokenView, event *models.Event) error {
|
||||
return usr_view.PutToken(v.Db, tokenTable, token)
|
||||
}
|
||||
|
||||
func (v *View) DeleteToken(tokenID, instanceID string, event *models.Event) error {
|
||||
err := usr_view.DeleteToken(v.Db, tokenTable, tokenID, instanceID)
|
||||
if err != nil && !zerrors.IsNotFound(err) {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *View) DeleteSessionTokens(agentID, userID, instanceID string, event *models.Event) error {
|
||||
err := usr_view.DeleteSessionTokens(v.Db, tokenTable, agentID, userID, instanceID)
|
||||
if err != nil && !zerrors.IsNotFound(err) {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *View) GetLatestState(ctx context.Context) (_ *query.CurrentState, err error) {
|
||||
q := &query.CurrentStateSearchQueries{
|
||||
Queries: make([]query.SearchQuery, 2),
|
||||
|
@ -454,7 +454,10 @@ func (h *Handler) executeStatement(ctx context.Context, tx *sql.Tx, currentState
|
||||
}
|
||||
var shouldContinue bool
|
||||
defer func() {
|
||||
_, err = tx.Exec("RELEASE SAVEPOINT exec")
|
||||
_, errSave := tx.Exec("RELEASE SAVEPOINT exec")
|
||||
if err == nil {
|
||||
err = errSave
|
||||
}
|
||||
}()
|
||||
|
||||
if err = statement.Execute(tx, h.projection.Name()); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user