Skip to content
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

Fix Event not being triggered when a new account is created through OAuth #2421

Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update account.php
  • Loading branch information
PineappleIOnic committed Nov 17, 2021
commit 12a2abd97056232873c22154658f6c9aa9f52edb
6 changes: 6 additions & 0 deletions app/controllers/api/account.php
Original file line number Diff line number Diff line change
Expand Up @@ -543,15 +543,21 @@
$functionsEvent
->setQueue('v1-functions')
->setClass('FunctionsV1')
->setParam('event', 'account.create')
->setParam('eventData', $response->output($user, Response::MODEL_USER))
->setParam('userId', $user->getId())
->setParam('resource', 'users/'.$user->getId())
->trigger();

$webhookEvent = clone $events;

$webhookEvent
->setQueue('v1-webhooks')
->setClass('WebhooksV1')
->setParam('event', 'account.create')
->setParam('eventData', $response->output($user, Response::MODEL_USER))
->setParam('userId', $user->getId())
->setParam('resource', 'users/'.$user->getId())
->trigger();
} catch (Duplicate $th) {
throw new Exception('Account already exists', 409);
Expand Down