Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Commit

Permalink
Merge pull request #898 from ivanwitzke/patch-1
Browse files Browse the repository at this point in the history
Catch exception and trigger fallback
  • Loading branch information
stevebauman authored Nov 11, 2020
2 parents 03dc1eb + 2a17981 commit 066715e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Auth/DatabaseUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 066715e

Please sign in to comment.