mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-29 20:11:32 +02:00
Use Agent.handleError in case checkAuth produces an error
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user