diff --git a/app/Http/Controllers/Auth/ContactLoginController.php b/app/Http/Controllers/Auth/ContactLoginController.php index f3e658f631c1..0c387a666405 100644 --- a/app/Http/Controllers/Auth/ContactLoginController.php +++ b/app/Http/Controllers/Auth/ContactLoginController.php @@ -165,7 +165,9 @@ class ContactLoginController extends Controller 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) { + $this->redirectTo = '/client/dashboard'; + } elseif (auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_INVOICES) { $this->redirectTo = '/client/invoices'; } elseif (auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_RECURRING_INVOICES) { $this->redirectTo = '/client/recurring_invoices'; diff --git a/app/Http/Controllers/ClientPortal/ContactHashLoginController.php b/app/Http/Controllers/ClientPortal/ContactHashLoginController.php index 11bbbb47a426..6567996e1d05 100644 --- a/app/Http/Controllers/ClientPortal/ContactHashLoginController.php +++ b/app/Http/Controllers/ClientPortal/ContactHashLoginController.php @@ -64,7 +64,9 @@ class ContactHashLoginController extends Controller 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'; 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';