Skip to content

Commit

Permalink
Fix inactive user creation (#23859)
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusbsilva137 authored Dec 3, 2021
1 parent 049956c commit ef94c08
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/authentication/server/startup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }>`);
Expand Down

0 comments on commit ef94c08

Please sign in to comment.