mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-05 16:01:18 +00:00
Return a 'not authorized' error if the user is not logged in/authorized
This commit is contained in:
parent
343ec9d708
commit
f4a465ea69
1 changed files with 8 additions and 4 deletions
|
@ -21,9 +21,13 @@ module.exports = Router =
|
|||
attrs[key] = value
|
||||
attrs.client_id = client.id
|
||||
attrs.err = error
|
||||
logger.error attrs, "server side error in #{method}"
|
||||
# Don't return raw error to prevent leaking server side info
|
||||
return callback {message: "Something went wrong in real-time service"}
|
||||
if error.message == "not authorized"
|
||||
logger.warn attrs, "client is not authorized"
|
||||
return callback {message: error.message}
|
||||
else
|
||||
logger.error attrs, "server side error in #{method}"
|
||||
# Don't return raw error to prevent leaking server side info
|
||||
return callback {message: "Something went wrong in real-time service"}
|
||||
|
||||
configure: (app, io, session) ->
|
||||
app.set("io", io)
|
||||
|
@ -99,4 +103,4 @@ module.exports = Router =
|
|||
if err?
|
||||
Router._handleError callback, err, client, "applyOtUpdate", {doc_id, update}
|
||||
else
|
||||
callback()
|
||||
callback()
|
||||
|
|
Loading…
Reference in a new issue