Skip to content

Commit c7dec28

Browse files
daprahamianmbroadst
authored andcommitted
fix(auth): remember to default to admin database
Fixes NODE-1765
1 parent 7a26748 commit c7dec28

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/operations/mongo_client_ops.js

+4
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,10 @@ function transformUrlOptions(_object) {
560560
object.auth = auth;
561561
object.user = auth.username;
562562
}
563+
564+
if (auth.db) {
565+
object.authSource = object.authSource || auth.db;
566+
}
563567
}
564568

565569
if (_object.defaultDatabase) {

0 commit comments

Comments
 (0)