Skip to content

Commit 06344d8

Browse files
2 parents fce1a49 + 11edab1 commit 06344d8

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'use strict'
2+
3+
module.exports = pluginOptions => ({ connection, command }) => {
4+
const password =
5+
command.password || pluginOptions.password || connection.config.password;
6+
7+
return Buffer.from(`${password}\0`)
8+
};

lib/commands/auth_switch.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ const Packets = require('../packets/index.js');
99
const sha256_password = require('../auth_plugins/sha256_password');
1010
const caching_sha2_password = require('../auth_plugins/caching_sha2_password.js');
1111
const mysql_native_password = require('../auth_plugins/mysql_native_password.js');
12+
const mysql_clear_password = require('../auth_plugins/mysql_clear_password.js');
1213

1314
const standardAuthPlugins = {
1415
sha256_password: sha256_password({}),
1516
caching_sha2_password: caching_sha2_password({}),
16-
mysql_native_password: mysql_native_password({})
17+
mysql_native_password: mysql_native_password({}),
18+
mysql_clear_password: mysql_clear_password({})
1719
};
1820

1921
function warnLegacyAuthSwitch() {

0 commit comments

Comments
 (0)