Skip to content

Commit

Permalink
Fixed automatic login when sending OTP notification.
Browse files Browse the repository at this point in the history
  • Loading branch information
afsakar committed Jun 15, 2024
1 parent 36723fb commit 7b60e54
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Filament/Pages/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ protected function doLogin(): void
{
$data = $this->form->getState();

$this->checkCredentials($data);
if (! Filament::auth()->attempt($this->getCredentialsFromFormData($data), $data['remember'] ?? false)) {
$this->throwFailureValidationException();
}

$user = Filament::auth()->user();

Expand Down Expand Up @@ -283,7 +285,7 @@ protected function getCredentialsFromFormData(array $data): array

protected function checkCredentials($data): void
{
if (! Filament::auth()->attempt($this->getCredentialsFromFormData($data), $data['remember'] ?? false)) {
if(! Filament::auth()->validate($this->getCredentialsFromFormData($data))) {
$this->throwFailureValidationException();
}
}
Expand Down

0 comments on commit 7b60e54

Please sign in to comment.