mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Read user email from the URL in DELETE requests.
This commit is contained in:
parent
147d74d92a
commit
b16ebc1843
2 changed files with 3 additions and 2 deletions
|
@ -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)->
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in a new issue