Skip to content

Commit

Permalink
Fix webhook URL
Browse files Browse the repository at this point in the history
  • Loading branch information
jveski committed Jun 17, 2024
1 parent 77a7506 commit 4a8149c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions internal/keycloak/keycloak.go
Original file line number Diff line number Diff line change
Expand Up @@ -532,16 +532,15 @@ func (k *Keycloak) EnsureWebhook(ctx context.Context, callbackURL string) error
return fmt.Errorf("listing: %w", err)
}

url := fmt.Sprintf("%s/webhook", callbackURL)
for _, hook := range hooks {
if hook.URL == url {
if hook.URL == callbackURL {
return nil // already exists
}
}

return k.CreateWebhook(ctx, &Webhook{
Enabled: true,
URL: url,
URL: callbackURL,
EventTypes: []string{"admin.*"},
})
}
Expand Down

0 comments on commit 4a8149c

Please sign in to comment.