Skip to content

FIX: Allow setting blank secret on an existing webhook #33096

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default class AdminConfigAreasWebhookForm extends Component {
return {
payload_url: this.webhook.payload_url,
content_type: this.webhook.content_type,
secret: this.webhook.secret === "" ? null : this.webhook.secret,
Copy link
Contributor Author

@Drenmi Drenmi Jun 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was here because in previous versions of FormKit, validations (like length) would be applied to optional fields even if the field was blank. We needed to null it out to prevent that. That is fixed now.

secret: this.webhook.secret,
categories: this.webhook.categories,
group_names: this.webhook.group_names,
tag_names: this.webhook.tag_names,
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/admin/addon/models/web-hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default class WebHook extends RestModel {
return {
payload_url: this.payload_url,
content_type: this.content_type,
secret: this.secret,
secret: this.secret ?? "",
wildcard_web_hook: this.wildcard_web_hook,
verify_certificate: this.verify_certificate,
active: this.active,
Expand Down
Loading