Skip to content

Commit

Permalink
Merge pull request #2058 from teamhanko/fix-user-delete-webhook
Browse files Browse the repository at this point in the history
fix: use TriggerWebhook function instead of NotifyUserChange
  • Loading branch information
FreddyDevelop authored Feb 25, 2025
2 parents 63da219 + 4187417 commit 01f05da
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backend/flow_api/flow/profile/action_account_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package profile
import (
"fmt"
auditlog "github.com/teamhanko/hanko/backend/audit_log"
"github.com/teamhanko/hanko/backend/dto/admin"
"github.com/teamhanko/hanko/backend/flow_api/flow/shared"
"github.com/teamhanko/hanko/backend/flowpilot"
"github.com/teamhanko/hanko/backend/persistence/models"
Expand Down Expand Up @@ -61,7 +62,11 @@ func (a AccountDelete) Execute(c flowpilot.ExecutionContext) error {
}

deps.HttpContext.SetCookie(cookie)
utils.NotifyUserChange(deps.HttpContext, deps.Tx, deps.Persister, events.UserDelete, userModel.ID)

err = utils.TriggerWebhooks(deps.HttpContext, deps.Tx, events.UserDelete, admin.FromUserModel(*userModel))
if err != nil {
return fmt.Errorf("failed to trrigger webhook: %w", err)
}

return c.Continue(shared.StateProfileAccountDeleted)
}

0 comments on commit 01f05da

Please sign in to comment.