From fd2f2318e36e921cde9ec5e4a000b4f6a6068cbc Mon Sep 17 00:00:00 2001 From: Jonathan Reinink Date: Tue, 11 May 2021 08:09:50 -0400 Subject: [PATCH] Add request validation to login store endpoint --- app/Http/Controllers/LoginController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Http/Controllers/LoginController.php b/app/Http/Controllers/LoginController.php index 4ea700b..a24b98a 100644 --- a/app/Http/Controllers/LoginController.php +++ b/app/Http/Controllers/LoginController.php @@ -17,6 +17,11 @@ class LoginController extends Controller public function store() { + Request::validate([ + 'email' => ['required', 'string', 'email'], + 'password' => ['required', 'string'], + ]); + if (Auth::attempt(Request::only('email', 'password'), Request::boolean('remember'))) { Session::regenerate();