From 12ad6e77dd4fa5f34ecd36a94d4481764f85529b Mon Sep 17 00:00:00 2001 From: murtaza98 Date: Wed, 6 Sep 2023 19:44:41 +0530 Subject: [PATCH] fix: afterUserCreated callback not being triggered by users.create API --- apps/meteor/app/lib/server/functions/saveUser.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/meteor/app/lib/server/functions/saveUser.js b/apps/meteor/app/lib/server/functions/saveUser.js index f912626c833e1..5c36e959316a0 100644 --- a/apps/meteor/app/lib/server/functions/saveUser.js +++ b/apps/meteor/app/lib/server/functions/saveUser.js @@ -331,6 +331,9 @@ const saveNewUser = async function (userData, sendPassword) { } } + const user = await Users.findOneById(_id); + setImmediate(async () => callbacks.run('afterCreateUser', user)); + return _id; };