mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-23 18:51:36 +00:00
destroy session on dropbox webhook
This commit is contained in:
parent
c08a568664
commit
1b02dc72a3
2 changed files with 6 additions and 1 deletions
|
@ -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)
|
||||
res.send(200)
|
||||
req.session.destroy()
|
||||
|
|
|
@ -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 = {}
|
||||
|
|
Loading…
Reference in a new issue