diff --git a/app/Http/Controllers/Auth/ContactLoginController.php b/app/Http/Controllers/Auth/ContactLoginController.php index 7bd8b227cfdb..f741954fbdfa 100644 --- a/app/Http/Controllers/Auth/ContactLoginController.php +++ b/app/Http/Controllers/Auth/ContactLoginController.php @@ -35,8 +35,9 @@ class ContactLoginController extends Controller public function showLoginForm(Request $request) { - if ($request->subdomain) { - $company = Company::where('subdomain', $request->subdomain)->first(); + if (strpos($request->getHost(), 'invoicing.co') !== false) { + $subdomain = explode('.', $request->getHost())[0]; + $company = Company::where('subdomain', $subdomain)->first(); } elseif (Ninja::isSelfHost()) { $company = Account::first()->default_company; } else { diff --git a/resources/views/portal/ninja2020/auth/login.blade.php b/resources/views/portal/ninja2020/auth/login.blade.php index 72329438934a..4d9a89b46d77 100644 --- a/resources/views/portal/ninja2020/auth/login.blade.php +++ b/resources/views/portal/ninja2020/auth/login.blade.php @@ -15,14 +15,19 @@ alt="Background image"> @endif +