fix: skip send confirmation email if disabled

This commit is contained in:
Ahmed Bouhuolia
2024-05-23 10:09:48 +02:00
parent 1227111fae
commit 2c7da86a00
2 changed files with 7 additions and 0 deletions

View File

@@ -11,6 +11,9 @@ export interface ISystemUser extends Model {
password: string;
email: string;
verifyToken: string;
verified: boolean;
roleId: number;
tenantId: number;

View File

@@ -20,6 +20,10 @@ export class SendVerfiyMailOnSignUp {
private handleSendVerifyMailOnSignup = async ({
user,
}: IAuthSignedUpEventPayload) => {
// Can't continue if the user is verified.
if (user.verified) {
return;
}
const payload = {
email: user.email,
token: user.verifyToken,