Browse Source

Update PublicApiController, fix visibility for guests

Daniel Supernault 3 months ago
parent
commit
537e179537
1 changed files with 1 additions and 5 deletions
  1. 1 5
      app/Http/Controllers/PublicApiController.php

+ 1 - 5
app/Http/Controllers/PublicApiController.php

@@ -788,15 +788,11 @@ class PublicApiController extends Controller
 
     private function determineVisibility($profile, $user)
     {
-        if (! $user || ! isset($user->profile_id)) {
-            return [];
-        }
-
         if (! $profile || ! isset($profile['id'])) {
             return [];
         }
 
-        if ($profile['id'] == $user->profile_id) {
+        if ($user && $profile['id'] == $user->profile_id) {
             return ['public', 'unlisted', 'private'];
         }