Add request validation to login store endpoint

This commit is contained in:
Jonathan Reinink 2021-05-11 08:09:50 -04:00
parent d5fa662a54
commit fd2f2318e3
1 changed files with 5 additions and 0 deletions

View File

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