Normalize email input for registration and login

Trim and lowercase email before storing or attempting login to avoid mismatches from case or surrounding whitespace. Updated RegisteredUserController@store to save 'email' => strtolower(trim($request->email)) and LoginRequest@authenticate to call Auth::attempt with the normalized email input.
This commit is contained in:
Juan Felipe Duarte
2026-03-02 08:43:12 -05:00
parent afa135f29d
commit 36bf56b622
2 changed files with 2 additions and 2 deletions
@@ -67,7 +67,7 @@ class RegisteredUserController extends Controller
$user = User::create([
'name' => $request->name,
'email' => $request->email,
'email' => strtolower(trim($request->email)),
'password' => Hash::make($request->password),
'rol_id' => $rol_id,
'parent_id' => $referralUser ? $referralUser->id : null,