Skip to content

Commit

Permalink
fix: clear errors guest auth failure
Browse files Browse the repository at this point in the history
  • Loading branch information
mychidarko committed Nov 8, 2024
1 parent fab0362 commit 1a15c29
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,8 @@ public function middleware(string $middleware, callable $callback)
if ($this->user()) {
$callback();
}

auth()->clearErrors();
});
}

Expand Down Expand Up @@ -579,6 +581,14 @@ protected function getTokenFromSession()
return Session::get('auth.token');
}

/**
* Clear all errors caught
*/
public function clearErrors()
{
$this->errorsArray = [];
}

/**
* Return all errors caught
*/
Expand Down

0 comments on commit 1a15c29

Please sign in to comment.