mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
fix delete endpoint
This commit is contained in:
parent
3e0ad47873
commit
60009c6346
3 changed files with 5 additions and 5 deletions
|
@ -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)->
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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) ->
|
||||
|
|
Loading…
Reference in a new issue