Skip to content

Commit e7aa860

Browse files
committed
save username/password in handshake command to use them for auth_switch request response
1 parent aff0b1c commit e7aa860

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

lib/commands/client_handshake.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,18 @@ ClientHandshake.prototype.sendCredentials = function (connection) {
3636
console.log('Sending handshake packet: flags:%d=(%s)', this.clientFlags,
3737
flagNames(this.clientFlags).join(', '));
3838
}
39+
40+
this.user = connection.config.user;
41+
this.password = connection.config.password;
42+
this.passwordSha1 = connection.config.passwordSha1;
43+
this.database = connection.config.database;
44+
3945
var handshakeResponse = new Packets.HandshakeResponse({
4046
flags : this.clientFlags,
41-
user : connection.config.user,
42-
database: connection.config.database,
43-
password: connection.config.password,
44-
passwordSha1 : connection.config.passwordSha1,
47+
user : this.user,
48+
database: this.database,
49+
password: this.password,
50+
passwordSha1 : this.passwordSha1,
4551
charsetNumber : connection.config.charsetNumber,
4652
authPluginData1: this.handshake.authPluginData1,
4753
authPluginData2: this.handshake.authPluginData2,

0 commit comments

Comments
 (0)