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;