Adjust mail.send function
Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
parent
f512f7db3f
commit
9e52faa1bb
@ -15,17 +15,11 @@ async function createRegKey(eml){
|
||||
if (await message == false) { // This error should be handled in the upstream function
|
||||
const err = new Error("Message generation error");
|
||||
log.out(`registerServices.createRegKey: Error generating registration email`, "err")
|
||||
return 500
|
||||
return 500;
|
||||
}
|
||||
try { // Send the email
|
||||
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 await mail.send(message);
|
||||
}
|
||||
return 401;
|
||||
}
|
||||
|
||||
async function regUser(req) {
|
||||
|
Loading…
Reference in New Issue
Block a user