fix delete endpoint

This commit is contained in:
Tim Alby 2018-06-26 19:50:12 +02:00
parent 3e0ad47873
commit 60009c6346
3 changed files with 5 additions and 5 deletions

View file

@ -33,7 +33,7 @@ module.exports = UserEmailsController =
remove: (req, res, next) ->
userId = AuthenticationController.getLoggedInUserId(req)
email = EmailHelper.parseEmail(req.params.email)
email = EmailHelper.parseEmail(req.body.email)
return res.sendStatus 422 unless email?
UserUpdater.removeEmailAddress userId, email, (error)->

View file

@ -114,7 +114,7 @@ module.exports = class Router
webRouter.post '/user/emails',
AuthenticationController.requireLogin(),
UserEmailsController.add
webRouter.delete '/user/emails/:email',
webRouter.post '/user/emails/delete',
AuthenticationController.requireLogin(),
UserEmailsController.remove
webRouter.post '/user/emails/default',

View file

@ -78,9 +78,9 @@ define [
}
removeUserEmail = (email) ->
$http.delete "/user/emails/#{ encodeURIComponent(email) }", {
headers:
"X-CSRF-Token": window.csrfToken
$http.post "/user/emails/delete", {
email,
_csrf: window.csrfToken
}
isDomainBlacklisted = (domain) ->