Skip to content

Commit f036f7f

Browse files
feat: Add password authentication for Redis connection
This change adds support for password authentication when connecting to a Redis server. The `enableRedis` method now checks for a 'password' in the config array and uses it to authenticate if provided.
1 parent 5370734 commit f036f7f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Telegram.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,10 @@ public function enableRedis(array $config = []): Telegram
11091109
self::$redis_connection = new \Redis();
11101110
self::$redis_connection->connect($config['host'], $config['port']);
11111111

1112+
if (!empty($config['password'])) {
1113+
self::$redis_connection->auth($config['password']);
1114+
}
1115+
11121116
return $this;
11131117
}
11141118

0 commit comments

Comments
 (0)