Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async requestVerificationEmail(email: string): Promise {
if (!validators.validateEmail(email)) throw new AccountsError('Valid email must be provided');
try {
await this.transport.sendVerificationEmail(email);
} catch (err) {
throw new AccountsError(err.message);
}
}
}
async requestPasswordReset(email: string): Promise {
if (!validators.validateEmail(email)) throw new AccountsError('Valid email must be provided');
try {
await this.transport.sendResetPasswordEmail(email);
} catch (err) {
throw new AccountsError(err.message);
}
}