Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var Server = function() {
// TODO(flackr): Load users from disk / database.
this.users = {};
this.sessions = {};
// Connections that have not yet been authenticated.
this.authenticating = [];
this.nextId_ = 1;
this.authenticator = null;
if (process.env.AUTH_CLIENT_SECRET) {
var OAuth2 = require('google-auth-library').prototype.OAuth2;
var serverUrl = process.env.C9_HOSTNAME ?
('https://' + process.env.C9_HOSTNAME) :
'https://www.lobbyjs.com/circ';
this.authenticator = new OAuth2(process.env.AUTH_CLIENT_ID,
process.env.AUTH_CLIENT_SECRET, serverUrl + '/authenticate');
}
this.webServer_ = null;
this.webSocketServer_ = null;
if (!this.authenticator)
console.warn('Warning: Running without authentication support');
this.serve = serveStatic(((__dirname + '/') || '') + '../');
};