diff --git a/app/Http/Controllers/Auth/ContactLoginController.php b/app/Http/Controllers/Auth/ContactLoginController.php
index 4f4eaf1131d6..057adf6448e7 100644
--- a/app/Http/Controllers/Auth/ContactLoginController.php
+++ b/app/Http/Controllers/Auth/ContactLoginController.php
@@ -45,7 +45,7 @@ class ContactLoginController extends Controller
MultiDB::findAndSetDbByDomain(['subdomain' => $subdomain]);
$company = Company::where('subdomain', $subdomain)->first();
-
+
} elseif(Ninja::isHosted()){
MultiDB::findAndSetDbByDomain(['portal_domain' => $request->getSchemeAndHttpHost()]);
@@ -70,6 +70,9 @@ class ContactLoginController extends Controller
{
Auth::shouldUse('contact');
+ if(Ninja::isHosted() && $request->has('db'))
+ MultiDB::setDb($request->input('db'));
+
$this->validateLogin($request);
// If the class is using the ThrottlesLogins trait, we can automatically throttle
// the login attempts for this application. We'll key this by the username and
diff --git a/resources/views/portal/ninja2020/auth/login.blade.php b/resources/views/portal/ninja2020/auth/login.blade.php
index ec2e188f8ff3..69b1ff0a7183 100644
--- a/resources/views/portal/ninja2020/auth/login.blade.php
+++ b/resources/views/portal/ninja2020/auth/login.blade.php
@@ -52,6 +52,9 @@
{{ trans('texts.forgot_password') }}
+ @if($company)
+
+ @endif