webhook: matrix access_token helper text

This commit is contained in:
oliverpool 2024-04-09 11:06:36 +02:00
parent 5d45545ca1
commit 99830a40a1
5 changed files with 22 additions and 17 deletions

View file

@ -42,12 +42,10 @@ func (matrixHandler) UnmarshalForm(bind func(any)) forms.WebhookForm {
HomeserverURL string `binding:"Required;ValidUrl"`
RoomID string `binding:"Required"`
MessageType int
// enforce requirement of authorization_header
// (value will still be set in the embedded WebhookCoreForm)
AuthorizationHeader string `binding:"Required"`
AccessToken string `binding:"Required"`
}
bind(&form)
form.AuthorizationHeader = "Bearer " + strings.TrimSpace(form.AccessToken)
return forms.WebhookForm{
WebhookCoreForm: form.WebhookCoreForm,