Skip to content

Commit

Permalink
fix(NODE-3397): report more helpful error with unsupported authMechan…
Browse files Browse the repository at this point in the history
…ism in initial handshake (#2876)
  • Loading branch information
vkarpov15 committed Jul 2, 2021
1 parent 558182f commit 3ce148d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/core/connection/connect.js
Expand Up @@ -179,6 +179,9 @@ function prepareHandshakeDocument(authContext, callback) {
}

const authProvider = AUTH_PROVIDERS[credentials.mechanism];
if (authProvider == null) {
return callback(new MongoError(`No AuthProvider for ${credentials.mechanism} defined.`));
}
authProvider.prepare(handshakeDoc, authContext, callback);
return;
}
Expand Down

0 comments on commit 3ce148d

Please sign in to comment.