diff --git a/services/web/app/coffee/Features/User/UserPagesController.coffee b/services/web/app/coffee/Features/User/UserPagesController.coffee index e5b42ae9b7..a3398c0b70 100644 --- a/services/web/app/coffee/Features/User/UserPagesController.coffee +++ b/services/web/app/coffee/Features/User/UserPagesController.coffee @@ -23,4 +23,6 @@ module.exports = title: 'Login', redir: req.query.redir - + passwordResetPage : (req, res)-> + res.render 'user/passwordReset', + title: 'Password Reset', \ No newline at end of file diff --git a/services/web/app/coffee/controllers/UserController.coffee b/services/web/app/coffee/controllers/UserController.coffee index 3085972be7..1ef6706ba4 100644 --- a/services/web/app/coffee/controllers/UserController.coffee +++ b/services/web/app/coffee/controllers/UserController.coffee @@ -68,9 +68,7 @@ module.exports = to: user.email EmailHandler.sendEmail "welcome", emailOpts - requestPasswordReset : (req, res)-> - res.render 'user/passwordReset', - title: 'Password Reset', + doRequestPasswordReset : (req, res, next = (error) ->)-> email = sanitize.escape(req.body.email) diff --git a/services/web/app/coffee/router.coffee b/services/web/app/coffee/router.coffee index bca4499637..9ec34d0497 100644 --- a/services/web/app/coffee/router.coffee +++ b/services/web/app/coffee/router.coffee @@ -77,7 +77,7 @@ module.exports = class Router app.get '/user/settings', AuthenticationController.requireLogin(), UserController.settings app.post '/user/settings', AuthenticationController.requireLogin(), UserController.apiUpdate app.post '/user/password/update', AuthenticationController.requireLogin(), UserController.changePassword - app.get '/user/passwordreset', UserController.requestPasswordReset + app.get '/user/passwordreset', UserPagesController.passwordResetPage app.post '/user/passwordReset', UserController.doRequestPasswordReset app.del '/user/newsletter/unsubscribe', AuthenticationController.requireLogin(), UserController.unsubscribe app.del '/user', AuthenticationController.requireLogin(), UserController.deleteUser diff --git a/services/web/test/UnitTests/coffee/User/UserPagesControllerTests.coffee b/services/web/test/UnitTests/coffee/User/UserPagesControllerTests.coffee index 74cf9a5ced..589272487b 100644 --- a/services/web/test/UnitTests/coffee/User/UserPagesControllerTests.coffee +++ b/services/web/test/UnitTests/coffee/User/UserPagesControllerTests.coffee @@ -78,3 +78,13 @@ describe "UserPagesController", -> opts.redir.should.equal redirect done() @UserPagesController.loginPage @req, @res + + describe "passwordResetPage", -> + + it "should render the login page", (done)-> + @res.render = (page)=> + page.should.equal "user/passwordReset" + done() + @UserPagesController.passwordResetPage @req, @res + +