refactor(server/plugins): add user and password to mongoose connect options
This commit is contained in:
parent
494db75430
commit
696ce44290
@ -12,8 +12,15 @@ export default async function () {
|
|||||||
log.debug(mongoose.connection.modelNames());
|
log.debug(mongoose.connection.modelNames());
|
||||||
// mongoose.set("debug", true);
|
// mongoose.set("debug", true);
|
||||||
mongoose.set("overwriteModels", true);
|
mongoose.set("overwriteModels", true);
|
||||||
|
console.log(process.env);
|
||||||
try {
|
try {
|
||||||
await mongoose.connect(beep.database.uri);
|
await mongoose.connect(beep.database.uri, {
|
||||||
|
auth: {
|
||||||
|
username: beep.database.user,
|
||||||
|
password: beep.database.password,
|
||||||
|
},
|
||||||
|
authSource: "admin",
|
||||||
|
});
|
||||||
// if (!!!mongoose.connections.length)
|
// if (!!!mongoose.connections.length)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
Loading…
Reference in New Issue
Block a user