From 3adab566c5a105ad12c9e43905608daa7d1fa965 Mon Sep 17 00:00:00 2001 From: CarrnellTech <47834646+CarrnellTech@users.noreply.github.com> Date: Mon, 13 May 2024 11:40:27 -0500 Subject: [PATCH] Redirect client to dashboard at login if enabled -fix #9417 #9501 --- app/Http/Middleware/ContactKeyLogin.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Http/Middleware/ContactKeyLogin.php b/app/Http/Middleware/ContactKeyLogin.php index 953d07f13290..ce3711dbccc0 100644 --- a/app/Http/Middleware/ContactKeyLogin.php +++ b/app/Http/Middleware/ContactKeyLogin.php @@ -161,7 +161,9 @@ class ContactKeyLogin private function setRedirectPath() { - if (auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_INVOICES) { + if (auth()->guard('contact')->user()->client->getSetting('enable_client_portal_dashboard') === true) { + return '/client/dashboard'; + } elseif (auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_INVOICES) { return '/client/invoices'; } elseif (auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_RECURRING_INVOICES) { return '/client/recurring_invoices';