mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 11:44:21 -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) ->
|
remove: (req, res) ->
|
||||||
userId = AuthenticationController.getLoggedInUserId(req)
|
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?
|
return res.sendStatus 422 unless email?
|
||||||
|
|
||||||
UserUpdater.removeEmailAddress userId, email, (error)->
|
UserUpdater.removeEmailAddress userId, email, (error)->
|
||||||
|
|
|
@ -114,7 +114,7 @@ module.exports = class Router
|
||||||
webRouter.post '/user/emails',
|
webRouter.post '/user/emails',
|
||||||
AuthenticationController.requireLogin(),
|
AuthenticationController.requireLogin(),
|
||||||
UserEmailsController.add
|
UserEmailsController.add
|
||||||
webRouter.delete '/user/emails',
|
webRouter.delete '/user/emails/:email',
|
||||||
AuthenticationController.requireLogin(),
|
AuthenticationController.requireLogin(),
|
||||||
UserEmailsController.remove
|
UserEmailsController.remove
|
||||||
webRouter.post '/user/emails/default',
|
webRouter.post '/user/emails/default',
|
||||||
|
|
Loading…
Reference in a new issue