mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
lowercase password reset email
This commit is contained in:
parent
521befddd3
commit
dabed896be
2 changed files with 12 additions and 1 deletions
|
@ -9,7 +9,7 @@ module.exports =
|
|||
title:"Reset Password"
|
||||
|
||||
requestReset: (req, res)->
|
||||
email = req.body.email.trim()
|
||||
email = req.body.email.trim().toLowerCase()
|
||||
opts =
|
||||
endpointName:"auto_compile"
|
||||
timeInterval:60
|
||||
|
|
|
@ -63,6 +63,17 @@ describe "PasswordResetController", ->
|
|||
done()
|
||||
@PasswordResetController.requestReset @req, @res
|
||||
|
||||
it "should lowercase the email address", (done)->
|
||||
@email = "UPerCaseEMAIL@example.Com"
|
||||
@req.body.email = @email
|
||||
@RateLimiter.addCount.callsArgWith(1, null, true)
|
||||
@PasswordResetHandler.generateAndEmailResetToken.callsArgWith(1)
|
||||
@res.send = (code)=>
|
||||
code.should.equal 200
|
||||
@PasswordResetHandler.generateAndEmailResetToken.calledWith(@email.toLowerCase()).should.equal true
|
||||
done()
|
||||
@PasswordResetController.requestReset @req, @res
|
||||
|
||||
describe "setNewUserPassword", ->
|
||||
|
||||
it "should tell the user handler to reset the password", (done)->
|
||||
|
|
Loading…
Reference in a new issue