From 20c91e8e31bfd5c32733a15c61d7cc3592372215 Mon Sep 17 00:00:00 2001 From: Deon George Date: Wed, 3 Aug 2022 16:34:23 +1000 Subject: [PATCH] Using search while the session has expired will generate a 401 --- app/Http/Controllers/SearchController.php | 4 ++++ composer.lock | 18 +++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index a842a65..1334568 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -21,6 +21,10 @@ class SearchController extends Controller { $result = collect(); + // If the user isnt logged in + if (! Auth::user()) + abort(401,'Need to login'); + // If there isnt a term value, return null if (! $request->input('term')) return $result; diff --git a/composer.lock b/composer.lock index 8d8a581..3d5adfa 100644 --- a/composer.lock +++ b/composer.lock @@ -1913,16 +1913,16 @@ }, { "name": "laravel/framework", - "version": "v9.22.1", + "version": "v9.23.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "b3b3dd43b9899f23df6d1d3e5390bd4662947a46" + "reference": "c4eea9060d847b5c93957b203caa8f57544a76ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/b3b3dd43b9899f23df6d1d3e5390bd4662947a46", - "reference": "b3b3dd43b9899f23df6d1d3e5390bd4662947a46", + "url": "https://api.github.com/repos/laravel/framework/zipball/c4eea9060d847b5c93957b203caa8f57544a76ab", + "reference": "c4eea9060d847b5c93957b203caa8f57544a76ab", "shasum": "" }, "require": { @@ -1943,7 +1943,7 @@ "psr/log": "^1.0|^2.0|^3.0", "psr/simple-cache": "^1.0|^2.0|^3.0", "ramsey/uuid": "^4.2.2", - "symfony/console": "^6.0", + "symfony/console": "^6.0.3", "symfony/error-handler": "^6.0", "symfony/finder": "^6.0", "symfony/http-foundation": "^6.0", @@ -2089,7 +2089,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-07-26T16:16:33+00:00" + "time": "2022-08-02T14:24:44+00:00" }, { "name": "laravel/passport", @@ -3295,11 +3295,11 @@ }, { "name": "leenooks/laravel", - "version": "9.2.3", + "version": "9.2.4", "source": { "type": "git", "url": "https://dev.leenooks.net/leenooks/laravel", - "reference": "8e9ca4c531311da5e329cdf9647ca193915167cf" + "reference": "61f38aefe78b4d8af630aee8c50271e50084d63c" }, "require": { "creativeorange/gravatar": "^1.0", @@ -3338,7 +3338,7 @@ "laravel", "leenooks" ], - "time": "2022-08-02T12:34:20+00:00" + "time": "2022-08-03T06:32:38+00:00" }, { "name": "leenooks/laravel-theme",