diff --git a/src/Auth/DatabaseUserProvider.php b/src/Auth/DatabaseUserProvider.php index e6728cd..1a908f9 100644 --- a/src/Auth/DatabaseUserProvider.php +++ b/src/Auth/DatabaseUserProvider.php @@ -2,6 +2,7 @@ namespace Adldap\Laravel\Auth; +use Adldap\Auth\BindException; use Adldap\Laravel\Commands\Import; use Adldap\Laravel\Commands\SyncPassword; use Adldap\Laravel\Events\AuthenticatedWithCredentials; @@ -90,7 +91,13 @@ public function updateRememberToken(Authenticatable $user, $token) */ public function retrieveByCredentials(array $credentials) { - $user = Resolver::byCredentials($credentials); + try { + $user = Resolver::byCredentials($credentials); + } catch (BindException $e) { + if (!$this->isFallingBack()) { + throw $e; + } + } if ($user instanceof User) { return $this->setAndImportAuthenticatingUser($user);