You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
Add magical auth command.
Authentication is now remembered by the client and will be automatically sent to the server on every connection, including any reconnections.
This commit is contained in:
@ -1,13 +1,5 @@
|
||||
// Note - Eventually this functionality will be built in to the client library
|
||||
|
||||
var redis = require("redis"),
|
||||
client = redis.createClient();
|
||||
|
||||
// whenever the client connects, make sure to auth
|
||||
client.on("connect", function () {
|
||||
client.auth("somepass", redis.print);
|
||||
});
|
||||
|
||||
// This command is magical. Client stashes the password and will issue on every connect.
|
||||
client.auth("somepass");
|
||||
|
||||
// then do whatever you want
|
||||
|
Reference in New Issue
Block a user