fix bad references to mongo
This commit is contained in:
parent
d7323b23e9
commit
afa2d9df39
@ -53,7 +53,7 @@ class Server extends EventEmitter {
|
|||||||
this.mongodb = new MongoDB(this, { options: databases.mongodb, MONGO_HOST, MONGO_USER, MONGO_PORT, MONGO_PASS, MONGO_DB });
|
this.mongodb = new MongoDB(this, { options: databases.mongodb, MONGO_HOST, MONGO_USER, MONGO_PORT, MONGO_PASS, MONGO_DB });
|
||||||
this.userDatabase = new UserDatabase(this, this.mongodb, { validUserTypes });
|
this.userDatabase = new UserDatabase(this, this.mongodb, { validUserTypes });
|
||||||
this.authenticator = new Authenticator(this, this.app, this.userDatabase, {
|
this.authenticator = new Authenticator(this, this.app, this.userDatabase, {
|
||||||
mongo: this.mongodb.client,
|
mongo: this.mongodb,
|
||||||
secret: SECRET,
|
secret: SECRET,
|
||||||
discordID: DISCORD_ID,
|
discordID: DISCORD_ID,
|
||||||
discordScope: discord.scope,
|
discordScope: discord.scope,
|
||||||
|
@ -35,7 +35,7 @@ class Authenticator {
|
|||||||
if (!(users instanceof AbstractUserDatabase)) Util.fatal(new Error(`Expecting user database to be an instance inheriting AbstractUserDatabase`));
|
if (!(users instanceof AbstractUserDatabase)) Util.fatal(new Error(`Expecting user database to be an instance inheriting AbstractUserDatabase`));
|
||||||
this.userdb = users;
|
this.userdb = users;
|
||||||
|
|
||||||
if (!mongo) Util.fatal(new Error('Missing mongo client for '));
|
if (!mongo) Util.fatal(new Error('Missing mongo client for session store'));
|
||||||
|
|
||||||
this.logger = server.createLogger(this);
|
this.logger = server.createLogger(this);
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ class Authenticator {
|
|||||||
cookie.secure = cookie.secure && process.env.NODE_ENV !== 'development';
|
cookie.secure = cookie.secure && process.env.NODE_ENV !== 'development';
|
||||||
express.use(session({
|
express.use(session({
|
||||||
cookie,
|
cookie,
|
||||||
store: MongoStore.create({ client: mongo, dbName: 'sessions' }),
|
store: MongoStore.create({ client: mongo.client, dbName: mongo.database, touchAfter: 600 }),
|
||||||
secret,
|
secret,
|
||||||
resave: false,
|
resave: false,
|
||||||
saveUninitialized: true
|
saveUninitialized: true
|
||||||
|
Loading…
Reference in New Issue
Block a user