We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c706b93 commit 481cbffCopy full SHA for 481cbff
lib/handshake.js
@@ -58,12 +58,14 @@ function hexlify (input) {
58
59
module.exports = function auth (stream, opts, cb) {
60
// filter used to make a copy so we don't accidently change opts data
61
- let authMethods;
62
- if (opts.authMethods) {
63
- authMethods = opts.authMethods;
64
- } else {
+ let authMethods = opts.authMethods;
+ if (opts.authMethods === undefined) {
65
authMethods = constants.defaultAuthMethods;
66
}
+ const skipAuthentication = authMethods.length === 0;
+ if (skipAuthentication) {
67
+ return process.nextTick(() => { cb(null, null); });
68
+ }
69
stream.write('\0');
70
tryAuth(stream, authMethods.slice(), cb);
71
};
0 commit comments