Adjust mail.send function

Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
Fred Boniface 2023-04-05 12:40:58 +01:00
parent f512f7db3f
commit 9e52faa1bb

View File

@ -15,17 +15,11 @@ async function createRegKey(eml){
if (await message == false) { // This error should be handled in the upstream function if (await message == false) { // This error should be handled in the upstream function
const err = new Error("Message generation error"); const err = new Error("Message generation error");
log.out(`registerServices.createRegKey: Error generating registration email`, "err") log.out(`registerServices.createRegKey: Error generating registration email`, "err")
return 500 return 500;
} }
try { // Send the email return await mail.send(message);
await mail.send(message);
} catch(err){ // HTTP 500 if sen failed
return 500
}
return 201 // These returns still need handling
} else {
return 401 // As above
} }
return 401;
} }
async function regUser(req) { async function regUser(req) {