From 206fbb193bc9aea3fe911d2de2b9231466b67fa7 Mon Sep 17 00:00:00 2001 From: Philipp Lang Date: Mon, 29 Aug 2022 11:57:17 +0200 Subject: [PATCH] Add validation for email --- app/Http/Controllers/Auth/LoginController.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index e184afa7..f9973769 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -5,6 +5,7 @@ namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use App\Providers\RouteServiceProvider; use Illuminate\Foundation\Auth\AuthenticatesUsers; +use Illuminate\Http\Request; use Inertia\Response; class LoginController extends Controller @@ -43,4 +44,15 @@ class LoginController extends Controller { return \Inertia::render('VLogin'); } + + /** + * Validate the user login request. + */ + protected function validateLogin(Request $request): void + { + $request->validate([ + $this->username() => 'required|max:255|string|email', + 'password' => 'required|string', + ]); + } }