X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/98ab3c1ffb6cbc851ec73c73a4310cbbbca2a6ce..refs/pull/2511/head:/app/Auth/Access/Guards/LdapSessionGuard.php diff --git a/app/Auth/Access/Guards/LdapSessionGuard.php b/app/Auth/Access/Guards/LdapSessionGuard.php index 84f54ad29..652141c0c 100644 --- a/app/Auth/Access/Guards/LdapSessionGuard.php +++ b/app/Auth/Access/Guards/LdapSessionGuard.php @@ -60,10 +60,8 @@ class LdapSessionGuard extends ExternalBaseSessionGuard * @param array $credentials * @param bool $remember * @return bool - * @throws LoginAttemptEmailNeededException * @throws LoginAttemptException * @throws LdapException - * @throws UserRegistrationException */ public function attempt(array $credentials = [], $remember = false) { @@ -82,7 +80,11 @@ class LdapSessionGuard extends ExternalBaseSessionGuard } if (is_null($user)) { - $user = $this->createNewFromLdapAndCreds($userDetails, $credentials); + try { + $user = $this->createNewFromLdapAndCreds($userDetails, $credentials); + } catch (UserRegistrationException $exception) { + throw new LoginAttemptException($exception->message); + } } // Sync LDAP groups if required