From 6fefc05fd146ec7ab4db56ab5986f24a46ad6b84 Mon Sep 17 00:00:00 2001 From: Ilario Pierbattista <987038+ilario-pierbattista@users.noreply.github.com> Date: Thu, 14 Jan 2021 11:05:44 +0100 Subject: [PATCH] Removing fallback logic about authSource (#101) --- src/Services/ClientRegistry.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Services/ClientRegistry.php b/src/Services/ClientRegistry.php index 8707fbc..7907acf 100644 --- a/src/Services/ClientRegistry.php +++ b/src/Services/ClientRegistry.php @@ -114,10 +114,8 @@ public function getClient(string $name, ?string $databaseName = null): Client if (! isset($this->clients[$clientKey])) { $conf = $this->configurations[$name]; $options = array_merge( - [ - 'database' => $databaseName, - 'authSource' => $conf->getAuthSource() ?? $databaseName ?? 'admin', - ], + ['database' => $databaseName], + $conf->getAuthSource() !== null ? ['authSource' => $conf->getAuthSource()] : [], $conf->getOptions() ); $this->clients[$clientKey] = $this->buildClient($name, $conf->getUri(), $options, $conf->getDriverOptions());