diff --git a/services/web/app/coffee/Features/Collaborators/CollaboratorsController.coffee b/services/web/app/coffee/Features/Collaborators/CollaboratorsController.coffee index 13cc60287f..e956b7f6bf 100644 --- a/services/web/app/coffee/Features/Collaborators/CollaboratorsController.coffee +++ b/services/web/app/coffee/Features/Collaborators/CollaboratorsController.coffee @@ -4,7 +4,6 @@ EditorController = require "../Editor/EditorController" module.exports = CollaboratorsController = getCollaborators: (req, res, next = (error) ->) -> - req.session.destroy() ProjectGetter.getProject req.params.Project_id, { owner_ref: true, collaberator_refs: true, readOnly_refs: true}, (error, project) -> return next(error) if error? ProjectGetter.populateProjectWithUsers project, (error, project) -> diff --git a/services/web/app/coffee/Features/Documents/DocumentController.coffee b/services/web/app/coffee/Features/Documents/DocumentController.coffee index 9cf8525bac..1170da2ef4 100644 --- a/services/web/app/coffee/Features/Documents/DocumentController.coffee +++ b/services/web/app/coffee/Features/Documents/DocumentController.coffee @@ -15,7 +15,6 @@ module.exports = res.send JSON.stringify { lines: lines } - req.session.destroy() setDocument: (req, res, next = (error) ->) -> project_id = req.params.Project_id @@ -28,7 +27,6 @@ module.exports = return next(error) logger.log doc_id:doc_id, project_id:project_id, "finished receiving set document request from api (docupdater)" res.send 200 - req.session.destroy() diff --git a/services/web/app/coffee/Features/ThirdPartyDataStore/TpdsController.coffee b/services/web/app/coffee/Features/ThirdPartyDataStore/TpdsController.coffee index ef22e1764c..3dbb30f75c 100644 --- a/services/web/app/coffee/Features/ThirdPartyDataStore/TpdsController.coffee +++ b/services/web/app/coffee/Features/ThirdPartyDataStore/TpdsController.coffee @@ -21,7 +21,6 @@ module.exports = else logger.log user_id:user_id, filePath:filePath, projectName:projectName, "telling tpds update has been processed" res.send 200 - req.session.destroy() deleteUpdate: (req, res)-> @@ -36,7 +35,6 @@ module.exports = else logger.log user_id:user_id, filePath:filePath, projectName:projectName, "telling tpds delete has been processed" res.send 200 - req.session.destroy() # updateProjectContents and deleteProjectContents are used by GitHub. The project_id is known so we # can skip right ahead to creating/updating/deleting the file. These methods will not ignore noisy @@ -50,7 +48,6 @@ module.exports = UpdateMerger.mergeUpdate project_id, path, req, source, (error) -> return next(error) if error? res.send(200) - req.session.destroy() deleteProjectContents: (req, res, next = (error) ->) -> {project_id} = req.params @@ -60,7 +57,6 @@ module.exports = UpdateMerger.deleteUpdate project_id, path, source, (error) -> return next(error) if error? res.send(200) - req.session.destroy() parseParams: parseParams = (req)-> path = req.params[0] diff --git a/services/web/app/coffee/Features/User/UserController.coffee b/services/web/app/coffee/Features/User/UserController.coffee index a374939545..643404a14d 100644 --- a/services/web/app/coffee/Features/User/UserController.coffee +++ b/services/web/app/coffee/Features/User/UserController.coffee @@ -20,7 +20,7 @@ module.exports = user_id = req.session.user._id UserDeleter.deleteUser user_id, (err)-> if !err? - req.session.destroy() + req.session?.destroy() res.send(200) unsubscribe: (req, res)-> diff --git a/services/web/app/coffee/Features/User/UserInfoController.coffee b/services/web/app/coffee/Features/User/UserInfoController.coffee index 65cbd34bad..ac7556bc90 100644 --- a/services/web/app/coffee/Features/User/UserInfoController.coffee +++ b/services/web/app/coffee/Features/User/UserInfoController.coffee @@ -9,7 +9,7 @@ module.exports = UserController = # this is funcky as hell, we don't use the current session to get the user # we use the auth token, actually destroying session from the chat api request if req.query?.auth_token? - req.session.destroy() + req.session?.destroy() logger.log user: req.user, "reciving request for getting logged in users personal info" return next(new Error("User is not logged in")) if !req.user? UserGetter.getUser req.user._id, { @@ -26,7 +26,6 @@ module.exports = UserController = return next(error) if error? return res.send(404) if !user? UserController.sendFormattedPersonalInfo(user, res, next) - req.session.destroy() sendFormattedPersonalInfo: (user, res, next = (error) ->) -> UserController._formatPersonalInfo user, (error, info) -> diff --git a/services/web/test/UnitTests/coffee/Project/ProjectApiControllerTests.coffee b/services/web/test/UnitTests/coffee/Project/ProjectApiControllerTests.coffee index fbd50bb3ce..322d61750e 100644 --- a/services/web/test/UnitTests/coffee/Project/ProjectApiControllerTests.coffee +++ b/services/web/test/UnitTests/coffee/Project/ProjectApiControllerTests.coffee @@ -40,10 +40,3 @@ describe 'Project api controller', -> resCode.should.equal 500 done() @controller.getProjectDetails @req, @res - - it "should destroy the session", (done)-> - @ProjectDetailsHandler.getDetails.callsArgWith(1, null, @projDetails) - @res.json = (data)=> - @req.session.destroy.called.should.equal true - done() - @controller.getProjectDetails @req, @res \ No newline at end of file diff --git a/services/web/test/UnitTests/coffee/ThirdPartyDataStore/TpdsControllerTests.coffee b/services/web/test/UnitTests/coffee/ThirdPartyDataStore/TpdsControllerTests.coffee index e43737a478..769582a95a 100644 --- a/services/web/test/UnitTests/coffee/ThirdPartyDataStore/TpdsControllerTests.coffee +++ b/services/web/test/UnitTests/coffee/ThirdPartyDataStore/TpdsControllerTests.coffee @@ -98,8 +98,6 @@ describe 'TpdsController', -> it "should return a success", -> @res.send.calledWith(200).should.equal true - it "should clear the session", -> - @req.session.destroy.called.should.equal true describe 'deleteProjectContents', -> beforeEach -> @@ -125,6 +123,3 @@ describe 'TpdsController', -> it "should return a success", -> @res.send.calledWith(200).should.equal true - it "should clear the session", -> - @req.session.destroy.called.should.equal true -