@@ -992,7 +992,6 @@ var Db = function(databaseName, topology, options) {
992
992
*/
993
993
this . authenticate = function ( username , password , options , callback ) {
994
994
if ( typeof options == 'function' ) callback = options , options = { } ;
995
- // console.log("---------------------------------------- AUTH 0 :: " + options.authMechanism)
996
995
// Set default mechanism
997
996
if ( ! options . authMechanism ) {
998
997
options . authMechanism = 'MONGODB-CR' ;
@@ -1020,21 +1019,15 @@ var Db = function(databaseName, topology, options) {
1020
1019
handleCallback ( callback , err , result ) ;
1021
1020
}
1022
1021
1023
- // console.log("---------------------------------------- AUTH :: " + options.authMechanism)
1024
-
1025
1022
// authMechanism
1026
1023
var authMechanism = options . authMechanism || '' ;
1027
1024
authMechanism = authMechanism . toUpperCase ( ) ;
1028
1025
1029
1026
// If classic auth delegate to auth command
1030
1027
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 ) ;
1038
1031
} ) ;
1039
1032
} else if ( authMechanism == 'PLAIN' ) {
1040
1033
topology . auth ( 'plain' , authdb , username , password , function ( err , result ) {
0 commit comments