mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-04 14:49:01 +02:00
changing email address should lowercase the email
This commit is contained in:
@@ -54,7 +54,7 @@ module.exports =
|
||||
if req.body.pdfViewer?
|
||||
user.ace.pdfViewer = req.body.pdfViewer
|
||||
user.save (err)->
|
||||
newEmail = req.body.email?.trim()
|
||||
newEmail = req.body.email?.trim().toLowerCase()
|
||||
if !newEmail? or newEmail == user.email
|
||||
return res.send 200
|
||||
else if newEmail.indexOf("@") == -1
|
||||
|
||||
@@ -134,7 +134,7 @@ describe "UserController", ->
|
||||
@UserController.updateUserSettings @req, @res
|
||||
|
||||
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)
|
||||
@res.send = (code)=>
|
||||
code.should.equal 200
|
||||
|
||||
Reference in New Issue
Block a user