Fixes for Company Switcher

This commit is contained in:
David Bomba 2021-10-24 20:33:23 +11:00
parent 37842985a3
commit e67fea2c33
2 changed files with 3 additions and 3 deletions

View File

@ -81,8 +81,8 @@ class ContactLoginController extends Controller
{ {
Auth::shouldUse('contact'); Auth::shouldUse('contact');
if(Ninja::isHosted() && $request->has('db')) if(Ninja::isHosted() && $request->has('company_key'))
MultiDB::setDb($request->input('db')); MultiDB::findAndSetDbByCompanyKey($request->input('company_key'));
$this->validateLogin($request); $this->validateLogin($request);
// If the class is using the ThrottlesLogins trait, we can automatically throttle // If the class is using the ThrottlesLogins trait, we can automatically throttle

View File

@ -27,7 +27,7 @@ class SwitchCompanyController extends Controller
->where('id', $this->transformKeys($contact)) ->where('id', $this->transformKeys($contact))
->first(); ->first();
auth()->guard('contact')->user()->login($client_contact, true); auth()->guard('contact')->login($client_contact, true);
return redirect('/client/dashboard'); return redirect('/client/dashboard');
} }