mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
Merge pull request #52699 from nextcloud/fix/noid/AppAPI-invalid-userId
fix(webhooks_listener): correctly set userId from event
This commit is contained in:
commit
c7430d5cb8
2 changed files with 3 additions and 1 deletions
|
|
@ -74,7 +74,8 @@ class WebhookCall extends QueuedJob {
|
|||
} elseif (!$exApp['enabled']) {
|
||||
throw new RuntimeException('ExApp ' . $exAppId . ' is disabled.');
|
||||
}
|
||||
$response = $appApiFunctions->exAppRequest($exAppId, $webhookUri, $webhookListener->getUserId(), $webhookListener->getHttpMethod(), [], $options);
|
||||
$userId = ($data['user'] ?? [])['uid'] ?? null;
|
||||
$response = $appApiFunctions->exAppRequest($exAppId, $webhookUri, $userId, $webhookListener->getHttpMethod(), [], $options);
|
||||
if (is_array($response) && isset($response['error'])) {
|
||||
throw new RuntimeException(sprintf('Error during request to ExApp(%s): %s', $exAppId, $response['error']));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ class WebhooksEventListener implements IEventListener {
|
|||
// TODO add group membership to be able to filter on it
|
||||
$data = [
|
||||
'event' => $this->serializeEvent($event),
|
||||
/* Do not remove 'user' from here, see BackgroundJobs/WebhookCall.php */
|
||||
'user' => (is_null($user) ? null : JsonSerializer::serializeUser($user)),
|
||||
'time' => time(),
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in a new issue