Remove deprecated endpoint for old delete-user

This commit is contained in:
Shane Kilkelly 2016-10-26 11:18:36 +01:00
parent a4167fcccd
commit dc62b1a86e
3 changed files with 0 additions and 19 deletions

View file

@ -15,14 +15,6 @@ settings = require "settings-sharelatex"
module.exports = UserController =
# TODO: deprecated, remove
deleteUser: (req, res)->
user_id = AuthenticationController.getLoggedInUserId(req)
UserDeleter.deleteUser user_id, (err)->
if !err?
req.session?.destroy()
res.sendStatus(200)
tryDeleteUser: (req, res, next) ->
user_id = AuthenticationController.getLoggedInUserId(req)
password = req.body.password

View file

@ -92,7 +92,6 @@ module.exports = class Router
webRouter.post '/user/sessions/clear', AuthenticationController.requireLogin(), UserController.clearSessions
webRouter.delete '/user/newsletter/unsubscribe', AuthenticationController.requireLogin(), UserController.unsubscribe
webRouter.delete '/user', AuthenticationController.requireLogin(), UserController.deleteUser
webRouter.post '/user/delete', AuthenticationController.requireLogin(), UserController.tryDeleteUser
webRouter.get '/user/personal_info', AuthenticationController.requireLogin(), UserInfoController.getLoggedInUsersPersonalInfo

View file

@ -85,16 +85,6 @@ describe "UserController", ->
json: sinon.stub()
@next = sinon.stub()
describe "deleteUser", ->
it "should delete the user", (done)->
@res.sendStatus = (code)=>
@UserDeleter.deleteUser.calledWith(@user_id)
code.should.equal 200
done()
@UserController.deleteUser @req, @res
describe 'tryDeleteUser', ->
beforeEach ->