From ef94c08b9e8399603e8365138504b6654d47b704 Mon Sep 17 00:00:00 2001 From: Matheus Barbosa Silva <36537004+matheusbsilva137@users.noreply.github.com> Date: Fri, 3 Dec 2021 18:38:04 -0300 Subject: [PATCH] Fix inactive user creation (#23859) --- app/authentication/server/startup/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/authentication/server/startup/index.js b/app/authentication/server/startup/index.js index ed98b62aaf28..3f3b5acc5f8d 100644 --- a/app/authentication/server/startup/index.js +++ b/app/authentication/server/startup/index.js @@ -186,7 +186,8 @@ Accounts.onCreateUser(function(options, user = {}) { if (!user.active) { const destinations = []; - Promise.await(Roles.findUsersInRole('admin').toArray()).forEach((adminUser) => { + const usersInRole = Promise.await(Roles.findUsersInRole('admin')); + Promise.await(usersInRole.toArray()).forEach((adminUser) => { if (Array.isArray(adminUser.emails)) { adminUser.emails.forEach((email) => { destinations.push(`${ adminUser.name }<${ email.address }>`);