Skip to content

Commit

Permalink
feat(authentication): remove verification requirement for forgot pass…
Browse files Browse the repository at this point in the history
…word

feat(authentication): change previous default team status when assigning a new one
  • Loading branch information
kkopanidis committed May 20, 2024
1 parent 46f801d commit 369958f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions modules/authentication/src/admin/team.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion modules/authentication/src/handlers/local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 369958f

Please sign in to comment.