mailer: fix error handling
previous mailer code has no callback and thus no way to pass back errors. now with asyncification it passes back the error
This commit is contained in:
@@ -556,7 +556,7 @@ async function sendPasswordResetByIdentifier(identifier, auditSource) {
|
||||
|
||||
await update(user, { resetToken, resetTokenCreationTime }, auditSource);
|
||||
|
||||
mailer.passwordReset(user);
|
||||
await mailer.passwordReset(user);
|
||||
}
|
||||
|
||||
async function notifyLoginLocation(user, ip, userAgent, auditSource) {
|
||||
@@ -596,7 +596,7 @@ async function notifyLoginLocation(user, ip, userAgent, auditSource) {
|
||||
|
||||
await update(user, { loginLocations }, auditSource);
|
||||
|
||||
mailer.sendNewLoginLocation(user, newLoginLocation);
|
||||
await mailer.sendNewLoginLocation(user, newLoginLocation);
|
||||
}
|
||||
|
||||
async function setPassword(user, newPassword, auditSource) {
|
||||
@@ -677,7 +677,7 @@ async function sendInvite(user, options) {
|
||||
|
||||
const directoryConfig = await settings.getDirectoryConfig();
|
||||
|
||||
mailer.sendInvite(user, options.invitor || null, inviteLink(user, directoryConfig));
|
||||
await mailer.sendInvite(user, options.invitor || null, inviteLink(user, directoryConfig));
|
||||
}
|
||||
|
||||
async function setupAccount(user, data, auditSource) {
|
||||
|
||||
Reference in New Issue
Block a user