diff --git a/app/Http/Controllers/Auth/ContactLoginController.php b/app/Http/Controllers/Auth/ContactLoginController.php index 4074229c5f..37530b5fb6 100644 --- a/app/Http/Controllers/Auth/ContactLoginController.php +++ b/app/Http/Controllers/Auth/ContactLoginController.php @@ -41,7 +41,10 @@ class ContactLoginController extends Controller }elseif (strpos($request->getHost(), 'invoicing.co') !== false) { $subdomain = explode('.', $request->getHost())[0]; $company = Company::where('subdomain', $subdomain)->first(); - } elseif (Ninja::isSelfHost()) { + } elseif(Ninja::isHosted() && $company = Company::where('portal_domain', $request->getSchemeAndHttpHost())->first()){ + + } + elseif (Ninja::isSelfHost()) { $company = Account::first()->default_company; } else { $company = null;