diff --git a/src/Auth.php b/src/Auth.php index fa92c5a..7b1b92a 100644 --- a/src/Auth.php +++ b/src/Auth.php @@ -466,6 +466,8 @@ public function middleware(string $middleware, callable $callback) if ($this->user()) { $callback(); } + + auth()->clearErrors(); }); } @@ -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 */