Skip to content
This repository was archived by the owner on Feb 4, 2022. It is now read-only.

Commit d448089

Browse files
committed
refactor(mongo-credentials): support accepting auth from parser
The connection parser outputs auth information in a specific format which the current `MongoCredentials` does not properly parse. This allows us to pass the output of that parsing directly into the ctor
1 parent 586883c commit d448089

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/auth/mongo_credentials.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ class MongoCredentials {
4545
options = options || {};
4646
this.username = options.username;
4747
this.password = options.password;
48-
this.source = options.source;
49-
this.mechanism = options.mechanism;
48+
this.source = options.source || options.db;
49+
this.mechanism = options.mechanism || 'default';
5050
this.mechanismProperties = options.mechanismProperties;
5151
}
5252

0 commit comments

Comments
 (0)