diff --git a/src/Prometheus/Storage/Redis.php b/src/Prometheus/Storage/Redis.php index 0a4096e..3550992 100644 --- a/src/Prometheus/Storage/Redis.php +++ b/src/Prometheus/Storage/Redis.php @@ -198,7 +198,7 @@ private function ensureOpenConnection(): void $this->connectToServer(); $authParams = []; - if (isset($this->options['user'])) { + if (isset($this->options['user']) && $this->options['user'] !== '') { $authParams[] = $this->options['user']; } diff --git a/src/Prometheus/Storage/RedisNg.php b/src/Prometheus/Storage/RedisNg.php index 865a07e..0ef8793 100644 --- a/src/Prometheus/Storage/RedisNg.php +++ b/src/Prometheus/Storage/RedisNg.php @@ -198,7 +198,7 @@ private function ensureOpenConnection(): void $this->connectToServer(); $authParams = []; - if (isset($this->options['user'])) { + if (isset($this->options['user']) && $this->options['user'] !== '') { $authParams[] = $this->options['user']; }