From 9a630ca6b7f2208ea5800a710022cda446e74357 Mon Sep 17 00:00:00 2001 From: Phillip Rosen Date: Sat, 1 Oct 2011 17:11:29 -0400 Subject: [PATCH] adding auth --- lib/stores/redis.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/stores/redis.js b/lib/stores/redis.js index d4818950fc..407feded1b 100644 --- a/lib/stores/redis.js +++ b/lib/stores/redis.js @@ -69,18 +69,33 @@ function Redis (opts) { } else { opts.redisPub || (opts.redisPub = {}); this.pub = redis.createClient(opts.redisPub.port, opts.redisPub.host, opts.redisPub); + if(opts.redisPub.pass){ + this.pub.auth(opts.redisPub.pass, function(err) { + if (err) throw err; + }); + } } if (opts.redisSub instanceof RedisClient) { this.sub = opts.redisSub; } else { opts.redisSub || (opts.redisSub = {}); this.sub = redis.createClient(opts.redisSub.port, opts.redisSub.host, opts.redisSub); + if(opts.redisSub.pass){ + this.sub.auth(opts.redisSub.pass, function(err) { + if (err) throw err; + }); + } } if (opts.redisClient instanceof RedisClient) { this.cmd = opts.redisClient; } else { opts.redisClient || (opts.redisClient = {}); this.cmd = redis.createClient(opts.redisClient.port, opts.redisClient.host, opts.redisClient); + if(opts.redisClient.pass){ + this.cmd.auth(opts.redisClient.pass, function(err) { + if (err) throw err; + }); + } } Store.call(this, opts);