From 1a15c29dc15ad9763e3314baf204d7962a8de3e3 Mon Sep 17 00:00:00 2001 From: mychidarko Date: Fri, 8 Nov 2024 23:38:08 +0000 Subject: [PATCH] fix: clear errors guest auth failure --- src/Auth.php | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 */