mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
changing email address should lowercase the email
This commit is contained in:
parent
36264706f6
commit
7964616f02
2 changed files with 2 additions and 2 deletions
|
@ -54,7 +54,7 @@ module.exports =
|
||||||
if req.body.pdfViewer?
|
if req.body.pdfViewer?
|
||||||
user.ace.pdfViewer = req.body.pdfViewer
|
user.ace.pdfViewer = req.body.pdfViewer
|
||||||
user.save (err)->
|
user.save (err)->
|
||||||
newEmail = req.body.email?.trim()
|
newEmail = req.body.email?.trim().toLowerCase()
|
||||||
if !newEmail? or newEmail == user.email
|
if !newEmail? or newEmail == user.email
|
||||||
return res.send 200
|
return res.send 200
|
||||||
else if newEmail.indexOf("@") == -1
|
else if newEmail.indexOf("@") == -1
|
||||||
|
|
|
@ -134,7 +134,7 @@ describe "UserController", ->
|
||||||
@UserController.updateUserSettings @req, @res
|
@UserController.updateUserSettings @req, @res
|
||||||
|
|
||||||
it "should call the user updater with the new email and user _id", (done)->
|
it "should call the user updater with the new email and user _id", (done)->
|
||||||
@req.body.email = @newEmail
|
@req.body.email = @newEmail.toUpperCase()
|
||||||
@UserUpdater.changeEmailAddress.callsArgWith(2)
|
@UserUpdater.changeEmailAddress.callsArgWith(2)
|
||||||
@res.send = (code)=>
|
@res.send = (code)=>
|
||||||
code.should.equal 200
|
code.should.equal 200
|
||||||
|
|
Loading…
Reference in a new issue