Skip to content

Commit

Permalink
Merge pull request #67 from laravel-frontend-presets/fix/login-valida…
Browse files Browse the repository at this point in the history
…tion

draft: fix(login component validation not working)
  • Loading branch information
ryangjchandler authored Sep 22, 2020
2 parents 53f7c3e + 90df515 commit 93d6869
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions stubs/auth/app/Http/Livewire/Auth/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ class Login extends Component
/** @var bool */
public $remember = false;

protected $rules = [
'email' => ['required', 'email'],
'password' => ['required'],
];

public function authenticate()
{
$credentials = $this->validate([
'email' => ['required', 'email'],
'password' => ['required'],
]);
$this->validate();

if (!Auth::attempt($credentials, $this->remember)) {
if (!Auth::attempt(['email' => $this->email, 'password' => $this->password], $this->remember)) {
$this->addError('email', trans('auth.failed'));

return;
Expand Down

0 comments on commit 93d6869

Please sign in to comment.