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
+1 -1
View File
@@ -45,7 +45,7 @@ class LoginRequest extends FormRequest
{
$this->ensureIsNotRateLimited();
if (! Auth::attempt($this->only('email', 'password'), $this->boolean('remember'))) {
if (! Auth::attempt(['email' => strtolower(trim($this->input('email'))), 'password' => $this->input('password')], $this->boolean('remember'))) {
RateLimiter::hit($this->throttleKey());
throw ValidationException::withMessages([