]> BookStack Code Mirror - bookstack/blobdiff - app/Auth/Access/Guards/LdapSessionGuard.php
Added a custom link context toolbar
[bookstack] / app / Auth / Access / Guards / LdapSessionGuard.php
index 7f6965937a19929a43124c508de406e8c61eb90a..5a902af7655aa021b37b9faa1425047f2a258005 100644 (file)
@@ -84,7 +84,7 @@ class LdapSessionGuard extends ExternalBaseSessionGuard
             try {
                 $user = $this->createNewFromLdapAndCreds($userDetails, $credentials);
             } catch (UserRegistrationException $exception) {
-                throw new LoginAttemptException($exception->message);
+                throw new LoginAttemptException($exception->getMessage());
             }
         }
 
@@ -94,7 +94,7 @@ class LdapSessionGuard extends ExternalBaseSessionGuard
         }
 
         // Attach avatar if non-existent
-        if (is_null($user->avatar)) {
+        if (!$user->avatar()->exists()) {
             $this->ldapService->saveAndAttachAvatar($user, $userDetails);
         }