database auth stuff
This commit is contained in:
parent
46ecdd5c38
commit
36583590fd
@ -29,8 +29,11 @@ class MongoDB {
|
||||
this.logger.info('Initializing database connection.');
|
||||
|
||||
try {
|
||||
|
||||
const client = new MongoClient(this.config.url + this.config.database, { useUnifiedTopology: true });
|
||||
const auth = {
|
||||
username: process.env.API_DB_USERNAME,
|
||||
password: process.env.API_DB_PASSWORD
|
||||
};
|
||||
const client = new MongoClient(this.config.url + this.config.database, { auth });
|
||||
this.client = await client.connect();
|
||||
this.db = await this.client.db(this.config.database);
|
||||
this.logger.info('Database connected.');
|
||||
|
@ -146,7 +146,9 @@ class Manager extends EventEmitter {
|
||||
DISCORD_ID: env.DISCORD_ID,
|
||||
DISCORD_SCOPE: opts.discord.scope,
|
||||
DOMAIN: opts.domain,
|
||||
DEBUG: opts.debug
|
||||
DEBUG: opts.debug,
|
||||
API_DB_USERNAME: env.API_DB_USERNAME,
|
||||
API_DB_PASSWORD: env.API_DB_PASSWORD
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user