You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
Add support for Redis 6 auth pass [user]
(#1508)
* Add support for `auth pass user` * fix lint issues * fix typo * fix more lint issues * more lints fixes * reverse password user order * update redis-commands * Update individualCommands.js Clean code * Update individualCommands.js * Update auth.spec.js * Update index.js Co-authored-by: Leibale Eidelman <leibale1998@gmail.com>
This commit is contained in:
@@ -29,7 +29,11 @@ module.exports = function createClient (port_arg, host_arg, options) {
|
||||
// [redis:]//[[user][:password]@][host][:port][/db-number][?db=db-number[&password=bar[&option=value]]]
|
||||
if (parsed.slashes) { // We require slashes
|
||||
if (parsed.auth) {
|
||||
options.password = parsed.auth.slice(parsed.auth.indexOf(':') + 1);
|
||||
var columnIndex = parsed.auth.indexOf(':');
|
||||
options.password = parsed.auth.slice(columnIndex + 1);
|
||||
if (columnIndex > 0) {
|
||||
options.user = parsed.auth.slice(0, columnIndex);
|
||||
}
|
||||
}
|
||||
if (parsed.protocol) {
|
||||
if (parsed.protocol === 'rediss:') {
|
||||
|
Reference in New Issue
Block a user