fix(mongoose): password require username

This commit is contained in:
Luca 2018-01-23 07:26:57 +01:00 committed by GitHub
parent ec106bce41
commit 97da3ba12d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,9 +46,9 @@ module.exports = function (strapi) {
const connectOptions = {}
if (!_.isEmpty(username)) {
connectOptions.user = username
}
if (!_.isEmpty(password)) {
connectOptions.pass = password
if (!_.isEmpty(password)) {
connectOptions.pass = password
}
}
instance.connect(`mongodb://${host}:${port}/${database}`, connectOptions);