File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -16,14 +16,18 @@ var conn = mysql.createConnection({
16
16
user: ' test_user' ,
17
17
password: ' test' ,
18
18
database: ' test_database' ,
19
- authSwitchHandler : function (data , cb ) {
20
- if (data . pluginName === ' ssh-key-auth' ) {
19
+ authSwitchHandler : function ({pluginName, pluginData} , cb ) {
20
+ if (pluginName === ' ssh-key-auth' ) {
21
21
getPrivateKey (function (key ) {
22
- var response = encrypt (key, data . pluginData );
22
+ var response = encrypt (key, pluginData);
23
23
// continue handshake by sending response data
24
24
// respond with error to propagate error to connect/changeUser handlers
25
25
cb (null , response);
26
26
});
27
+ } else (
28
+ const err = new Error (` Unknown AuthSwitchRequest plugin name ${ pluginName} ` );
29
+ err .fatal = true ;
30
+ cb (err)
27
31
}
28
32
}
29
33
});
You can’t perform that action at this time.
0 commit comments