diff --git a/modules/authentication/src/admin/team.ts b/modules/authentication/src/admin/team.ts index a8bc68814..e2d3cca50 100644 --- a/modules/authentication/src/admin/team.ts +++ b/modules/authentication/src/admin/team.ts @@ -303,6 +303,9 @@ export class TeamsAdmin { throw new GrpcError(status.ALREADY_EXISTS, 'Team with that name already exists'); } } + if (!found.isDefault && isDefault) { + await Team.getInstance().updateOne({ isDefault: true }, { isDefault: false }); + } const updatedTeam = await Team.getInstance().findByIdAndUpdate(teamId, { name, diff --git a/modules/authentication/src/handlers/local.ts b/modules/authentication/src/handlers/local.ts index 82ee1692e..0c7976335 100644 --- a/modules/authentication/src/handlers/local.ts +++ b/modules/authentication/src/handlers/local.ts @@ -348,7 +348,7 @@ export class LocalHandlers implements IAuthenticationStrategy { }); const link = `${redirectUri}?reset_token=${passwordResetTokenDoc.token}`; - if (config.local.verification.send_email && this.grpcSdk.isAvailable('email')) { + if (this.grpcSdk.isAvailable('email')) { await this.emailModule .sendEmail('ForgotPassword', { email: user.email,