We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 865126c commit 57fd2f5Copy full SHA for 57fd2f5
lib/socket.ts
@@ -229,10 +229,11 @@ export const Socket = (
229
function redisOptsFromConnection(connection: Connection): RedisOptions {
230
let opts: RedisOptions = {
231
...pick(connection, [
232
- "port",
233
"host",
234
- "family",
+ "port",
+ "username",
235
"password",
236
+ "family",
237
"sentinelPassword",
238
"db",
239
"tls",
@@ -264,6 +265,8 @@ function redisOptsFromUrl(urlString: string) {
264
265
? parseInt(redisUrl.pathname.split("/")[1])
266
: 0;
267
if (redisUrl.auth) {
268
+ const username = redisUrl.auth.split(":")[0];
269
+ redisOpts.username = username ? username : undefined;
270
redisOpts.password = redisUrl.auth.split(":")[1];
271
}
272
} catch (e) {
0 commit comments