mirror of
https://github.com/teamhanko/hanko.git
synced 2025-10-28 06:37:57 +08:00
fix(webhooks): fix HasEvent logic
* fix premature return in the check which skips all following events when the first one was false * add test cases Closes: #1354
This commit is contained in:
@ -34,7 +34,9 @@ type BaseWebhook struct {
|
||||
|
||||
func (bh *BaseWebhook) HasEvent(evt events.Event) bool {
|
||||
for _, event := range bh.Events {
|
||||
return strings.HasPrefix(string(evt), string(event))
|
||||
if strings.HasPrefix(string(evt), string(event)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user