Commit 6b532313 authored by Mark Harding's avatar Mark Harding
Browse files

(fix): do not show suggestions to logged out users

parent 0e9537b5
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -16,6 +16,13 @@ class suggestions implements Interfaces\Api
        $type = $pages[0] ?? 'user';
        $type = $pages[0] ?? 'user';
        $loggedInUser = Core\Session::getLoggedinUser();
        $loggedInUser = Core\Session::getLoggedinUser();


        if (!$loggedInUser) {
			return Factory::response([
                'status' => 'error',
                'message' => 'You must be logged in to receive suggestions',
            ]);
        }

        if ($loggedInUser->getSubscriptionsCount() >= 5000) {
        if ($loggedInUser->getSubscriptionsCount() >= 5000) {
            return Factory::response([
            return Factory::response([
                'status' => 'error',
                'status' => 'error',