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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Drenmi
Copy link
Contributor

@Drenmi Drenmi commented Jun 6, 2025

What is this change?

We had a regression where you can no longer update an existing webhook to have a blank secret field.

The problem is the blank field will return a value of undefined, which is ignored by the store when sending the request to the back-end.

This fixes that by using the nullish coalescing operator to replace undefined with an empty string.

In action:

webhook-secret-fix

@@ -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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants