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) ->
|
remove: (req, res, next) ->
|
||||||
userId = AuthenticationController.getLoggedInUserId(req)
|
userId = AuthenticationController.getLoggedInUserId(req)
|
||||||
email = EmailHelper.parseEmail(req.params.email)
|
email = EmailHelper.parseEmail(req.body.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/:email',
|
webRouter.post '/user/emails/delete',
|
||||||
AuthenticationController.requireLogin(),
|
AuthenticationController.requireLogin(),
|
||||||
UserEmailsController.remove
|
UserEmailsController.remove
|
||||||
webRouter.post '/user/emails/default',
|
webRouter.post '/user/emails/default',
|
||||||
|
|
|
@ -78,9 +78,9 @@ define [
|
||||||
}
|
}
|
||||||
|
|
||||||
removeUserEmail = (email) ->
|
removeUserEmail = (email) ->
|
||||||
$http.delete "/user/emails/#{ encodeURIComponent(email) }", {
|
$http.post "/user/emails/delete", {
|
||||||
headers:
|
email,
|
||||||
"X-CSRF-Token": window.csrfToken
|
_csrf: window.csrfToken
|
||||||
}
|
}
|
||||||
|
|
||||||
isDomainBlacklisted = (domain) ->
|
isDomainBlacklisted = (domain) ->
|
||||||
|
|
Loading…
Reference in a new issue