Skip to content

Commit

Permalink
fix(auth): remember to default to admin database
Browse files Browse the repository at this point in the history
Fixes NODE-1765
  • Loading branch information
daprahamian authored and mbroadst committed Nov 16, 2018
1 parent 7a26748 commit c7dec28
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/operations/mongo_client_ops.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,10 @@ function transformUrlOptions(_object) {
object.auth = auth;
object.user = auth.username;
}

if (auth.db) {
object.authSource = object.authSource || auth.db;
}
}

if (_object.defaultDatabase) {
Expand Down

0 comments on commit c7dec28

Please sign in to comment.