mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
compose db conn params
This commit is contained in:
parent
12d100b3de
commit
ca426e77e3
@ -19,19 +19,22 @@ function getConnectionConfig(obj) {
|
||||
auth.push("/?authMechanism=DEFAULT")
|
||||
}
|
||||
|
||||
if (DB_AUTH_SOURCE && DB_USER) {
|
||||
auth.push(`&authSource=${DB_AUTH_SOURCE}`)
|
||||
auth = auth.join("")
|
||||
|
||||
const params = {
|
||||
auth: {},
|
||||
dbName: DB_NAME,
|
||||
useNewUrlParser: true,
|
||||
useUnifiedTopology: true,
|
||||
}
|
||||
|
||||
auth = auth.join("")
|
||||
if (DB_AUTH_SOURCE) {
|
||||
params.auth.authSource = DB_AUTH_SOURCE
|
||||
}
|
||||
|
||||
return [
|
||||
auth,
|
||||
{
|
||||
dbName: DB_NAME,
|
||||
useNewUrlParser: true,
|
||||
useUnifiedTopology: true,
|
||||
}
|
||||
params,
|
||||
]
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user