mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-24 00:31:39 +00: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:
parent
30c5bbfdfc
commit
69b9b308d4
2 changed files with 4 additions and 3 deletions
|
@ -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()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue