diff --git a/services/web/app/coffee/Features/Dropbox/DropboxWebhookController.coffee b/services/web/app/coffee/Features/Dropbox/DropboxWebhookController.coffee index 5726b51bc4..cfd83ef2b2 100644 --- a/services/web/app/coffee/Features/Dropbox/DropboxWebhookController.coffee +++ b/services/web/app/coffee/Features/Dropbox/DropboxWebhookController.coffee @@ -4,6 +4,7 @@ DropboxWebhookHandler = require("./DropboxWebhookHandler") module.exports = DropboxWebhookController = verify: (req, res, next = (error) ->) -> res.send(req.query.challenge) + req.session.destroy() webhook: (req, res, next = (error) ->) -> dropbox_uids = req.body?.delta?.users @@ -16,4 +17,5 @@ module.exports = DropboxWebhookController = if error? logger.error err: error, dropbox_uids: dropbox_uids, "error in webhook" - res.send(200) \ No newline at end of file + res.send(200) + req.session.destroy() diff --git a/services/web/test/UnitTests/coffee/Dropbox/DropboxWebhookControllerTests.coffee b/services/web/test/UnitTests/coffee/Dropbox/DropboxWebhookControllerTests.coffee index ad72827c78..10f2cdfbd4 100644 --- a/services/web/test/UnitTests/coffee/Dropbox/DropboxWebhookControllerTests.coffee +++ b/services/web/test/UnitTests/coffee/Dropbox/DropboxWebhookControllerTests.coffee @@ -6,6 +6,9 @@ modulePath = require('path').join __dirname, '../../../../app/js/Features/Dropbo describe 'DropboxWebhookController', -> beforeEach -> + @req = + session: + destroy: -> @DropboxWebhookController = SandboxedModule.require modulePath, requires: "./DropboxWebhookHandler": @DropboxWebhookHandler = {}