From b16ebc1843c4aa7aa95f844fe514c6d71bae7749 Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Thu, 21 Jun 2018 17:16:42 +0100 Subject: [PATCH] Read user email from the URL in DELETE requests. --- .../web/app/coffee/Features/User/UserEmailsController.coffee | 3 ++- services/web/app/coffee/router.coffee | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/services/web/app/coffee/Features/User/UserEmailsController.coffee b/services/web/app/coffee/Features/User/UserEmailsController.coffee index 07433d2dde..8f49dce82b 100644 --- a/services/web/app/coffee/Features/User/UserEmailsController.coffee +++ b/services/web/app/coffee/Features/User/UserEmailsController.coffee @@ -25,7 +25,8 @@ module.exports = UserEmailsController = remove: (req, res) -> userId = AuthenticationController.getLoggedInUserId(req) - email = EmailHelper.parseEmail(req.body.email) + logger.log req.params + email = EmailHelper.parseEmail(req.params.email) return res.sendStatus 422 unless email? UserUpdater.removeEmailAddress userId, email, (error)-> diff --git a/services/web/app/coffee/router.coffee b/services/web/app/coffee/router.coffee index 339b4abe1c..bfe1c60ffe 100644 --- a/services/web/app/coffee/router.coffee +++ b/services/web/app/coffee/router.coffee @@ -114,7 +114,7 @@ module.exports = class Router webRouter.post '/user/emails', AuthenticationController.requireLogin(), UserEmailsController.add - webRouter.delete '/user/emails', + webRouter.delete '/user/emails/:email', AuthenticationController.requireLogin(), UserEmailsController.remove webRouter.post '/user/emails/default',