diff --git a/app/authentication/server/startup/index.js b/app/authentication/server/startup/index.js index ed98b62aaf282..3f3b5acc5f8d6 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 }>`);