fix(nextcloud-talk): calculate signature over message text, not JSON body

NextCloud Talk's Bot API expects the HMAC signature to be calculated
over `random + message` (just the message text), not over the entire
JSON body `random + {"message":"..."}`.

This fix changes the signature calculation to use the plain message
text while keeping the HTTP request body as JSON.

Fixes authentication errors when bots try to send responses:
"Nextcloud Talk: authentication failed - check bot secret"

Closes #4073

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Markus Klein 2026-01-29 17:45:56 +01:00
parent 06289b36da
commit b93ab0ddf6

View File

@ -90,7 +90,7 @@ export async function sendMessageNextcloudTalk(
const bodyStr = JSON.stringify(body);
const { random, signature } = generateNextcloudTalkSignature({
body: bodyStr,
body: message,
secret,
});