From 8faa687ae40cc7faace45f4d559446fe5649458d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 12 Jan 2022 22:52:56 +1100 Subject: [PATCH] Return error message when dealing with clients who have been deleted --- app/Http/Middleware/CheckClientExistence.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Middleware/CheckClientExistence.php b/app/Http/Middleware/CheckClientExistence.php index a03f90528dcc..05ecd8214780 100644 --- a/app/Http/Middleware/CheckClientExistence.php +++ b/app/Http/Middleware/CheckClientExistence.php @@ -46,10 +46,11 @@ class CheckClientExistence }) ->get(); + /* This catches deleted clients who don't have access to the app. We automatically log them out here*/ if (count($multiple_contacts) == 0) { Auth::logout(); - return redirect()->route('client.login'); + return redirect()->route('client.login')->with('message', 'Login disabled'); } if (count($multiple_contacts) == 1 && !Auth::guard('contact')->check()) {