mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-17 19:21:04 +01:00
fix: #9822, use correct username/pwd
This commit is contained in:
@@ -12,7 +12,7 @@ connection.getConnectionString = function (mongo) {
|
||||
let usernamePassword = '';
|
||||
const uri = mongo.uri || '';
|
||||
if (mongo.username && mongo.password) {
|
||||
usernamePassword = `${nconf.get('mongo:username')}:${encodeURIComponent(nconf.get('mongo:password'))}@`;
|
||||
usernamePassword = `${mongo.username}:${encodeURIComponent(mongo.password)}@`;
|
||||
} else if (!uri.includes('@') || !uri.slice(uri.indexOf('://') + 3, uri.indexOf('@'))) {
|
||||
winston.warn('You have no mongo username/password setup!');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user