mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
20 lines
529 B
CoffeeScript
20 lines
529 B
CoffeeScript
|
Metrics = require "metrics-sharelatex"
|
||
|
logger = require "logger-sharelatex"
|
||
|
|
||
|
module.exports = Router =
|
||
|
configure: (app, io, session) ->
|
||
|
session.on 'connection', (error, client, session) ->
|
||
|
if error?
|
||
|
logger.err err: error, "error when client connected"
|
||
|
client?.disconnect()
|
||
|
return
|
||
|
|
||
|
Metrics.inc('socket-io.connection')
|
||
|
|
||
|
logger.log session: session, "got session"
|
||
|
|
||
|
user = session.user
|
||
|
if !user?
|
||
|
logger.log "terminating session without authenticated user"
|
||
|
client.disconnect()
|
||
|
return
|