diff --git a/services/web/app/coffee/Features/User/UserController.coffee b/services/web/app/coffee/Features/User/UserController.coffee index ba41904812..1515fc86f0 100644 --- a/services/web/app/coffee/Features/User/UserController.coffee +++ b/services/web/app/coffee/Features/User/UserController.coffee @@ -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 diff --git a/services/web/test/UnitTests/coffee/User/UserControllerTests.coffee b/services/web/test/UnitTests/coffee/User/UserControllerTests.coffee index 4612a77e0d..ec3fde5b3e 100644 --- a/services/web/test/UnitTests/coffee/User/UserControllerTests.coffee +++ b/services/web/test/UnitTests/coffee/User/UserControllerTests.coffee @@ -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