Skip to content

Commit 92168c6

Browse files
committed
Fixed auth test for the local auth exception in 2.8
1 parent 73e4a2c commit 92168c6

File tree

3 files changed

+295
-216
lines changed

3 files changed

+295
-216
lines changed

lib/db.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,6 @@ var Db = function(databaseName, topology, options) {
992992
*/
993993
this.authenticate = function(username, password, options, callback) {
994994
if(typeof options == 'function') callback = options, options = {};
995-
// console.log("---------------------------------------- AUTH 0 :: " + options.authMechanism)
996995
// Set default mechanism
997996
if(!options.authMechanism) {
998997
options.authMechanism = 'MONGODB-CR';
@@ -1020,21 +1019,15 @@ var Db = function(databaseName, topology, options) {
10201019
handleCallback(callback, err, result);
10211020
}
10221021

1023-
// console.log("---------------------------------------- AUTH :: " + options.authMechanism)
1024-
10251022
// authMechanism
10261023
var authMechanism = options.authMechanism || '';
10271024
authMechanism = authMechanism.toUpperCase();
10281025

10291026
// If classic auth delegate to auth command
10301027
if(authMechanism == 'MONGODB-CR') {
1031-
topology.auth('scram-sha-1', authdb, username, password, function(err, result) {
1032-
if(err == null && result == true) return _callback(null, true);
1033-
1034-
topology.auth('mongocr', authdb, username, password, function(err, result) {
1035-
if(err) return handleCallback(callback, err, false);
1036-
_callback(null, true);
1037-
});
1028+
topology.auth('mongocr', authdb, username, password, function(err, result) {
1029+
if(err) return handleCallback(callback, err, false);
1030+
_callback(null, true);
10381031
});
10391032
} else if(authMechanism == 'PLAIN') {
10401033
topology.auth('plain', authdb, username, password, function(err, result) {

0 commit comments

Comments
 (0)