mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
[WebsocketController] use the new NotAuthorizedError
This commit is contained in:
parent
a8c51de510
commit
59c4c884a5
1 changed files with 2 additions and 6 deletions
|
@ -9,6 +9,7 @@ const DocumentUpdaterManager = require('./DocumentUpdaterManager')
|
|||
const ConnectedUsersManager = require('./ConnectedUsersManager')
|
||||
const WebsocketLoadBalancer = require('./WebsocketLoadBalancer')
|
||||
const RoomManager = require('./RoomManager')
|
||||
const { NotAuthorizedError } = require('./Errors')
|
||||
|
||||
let WebsocketController
|
||||
module.exports = WebsocketController = {
|
||||
|
@ -48,12 +49,7 @@ module.exports = WebsocketController = {
|
|||
}
|
||||
|
||||
if (!privilegeLevel) {
|
||||
const err = new Error('not authorized')
|
||||
logger.warn(
|
||||
{ err, project_id, user_id, client_id: client.id },
|
||||
'user is not authorized to join project'
|
||||
)
|
||||
return callback(err)
|
||||
return callback(new NotAuthorizedError())
|
||||
}
|
||||
|
||||
client.ol_context = {}
|
||||
|
|
Loading…
Reference in a new issue