Skip to content

Commit

Permalink
fix: unable to create user if Accounts_ManuallyApproveNewUsers is ena…
Browse files Browse the repository at this point in the history
…bled (#29293)
  • Loading branch information
debdutdeb committed May 23, 2023
1 parent 7bf084f commit 1687bfb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/heavy-years-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

fix: Admins unable to create new users if new users require manual approval
2 changes: 1 addition & 1 deletion apps/meteor/app/authentication/server/startup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ const onCreateUserAsync = async function (options, user = {}) {
if (!user.active) {
const destinations = [];
const usersInRole = await Roles.findUsersInRole('admin');
await usersInRole.toArray().forEach((adminUser) => {
await usersInRole.forEach((adminUser) => {
if (Array.isArray(adminUser.emails)) {
adminUser.emails.forEach((email) => {
destinations.push(`${adminUser.name}<${email.address}>`);
Expand Down

0 comments on commit 1687bfb

Please sign in to comment.