mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
If sending email fails, return a generic error.
This prevents us from leaking juicy details of our aws/ses setup via the password-reset form.
This commit is contained in:
@@ -74,4 +74,4 @@ module.exports =
|
||||
logger.err err:err, "error sending message"
|
||||
else
|
||||
logger.log "Message sent to #{options.to}"
|
||||
callback(err)
|
||||
callback(new Error('Cannot send email'))
|
||||
|
||||
@@ -58,10 +58,11 @@ describe "EmailSender", ->
|
||||
args.subject.should.equal @opts.subject
|
||||
done()
|
||||
|
||||
it "should return the error", (done)->
|
||||
it "should return a non-specific error", (done)->
|
||||
@sesClient.sendMail.callsArgWith(1, "error")
|
||||
@sender.sendEmail {}, (err)=>
|
||||
err.should.equal "error"
|
||||
err.should.exist
|
||||
err.toString().should.equal 'Error: Cannot send email'
|
||||
done()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user