mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Use Agent.handleError in case checkAuth produces an error
This commit is contained in:
parent
0802403ee5
commit
c8a8fe6af7
1 changed files with 2 additions and 2 deletions
|
@ -24,8 +24,8 @@ module.exports = LinkedFilesController = {
|
|||
linkedFileData = Agent.sanitizeData(data)
|
||||
linkedFileData.provider = provider
|
||||
Agent.checkAuth project_id, data, user_id, (err, allowed) ->
|
||||
return next(err) if err?
|
||||
return ses.sendStatus(403) if !allowed
|
||||
return Agent.handleError(err, req, res, next) if err?
|
||||
return res.sendStatus(403) if !allowed
|
||||
Agent.writeIncomingFileToDisk project_id, linkedFileData, user_id, (error, fsPath) ->
|
||||
if error?
|
||||
logger.error {err: error, project_id, name, linkedFileData, parent_folder_id, user_id}, 'error writing linked file to disk'
|
||||
|
|
Loading…
Reference in a new issue