Using search while the session has expired will generate a 401

This commit is contained in:
Deon George 2022-08-03 16:34:23 +10:00
parent a52c20993b
commit 20c91e8e31
2 changed files with 13 additions and 9 deletions

View File

@ -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;

18
composer.lock generated
View File

@ -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",