Fixes for contact login

This commit is contained in:
David Bomba 2021-12-07 22:46:05 +11:00
parent 17e787f816
commit 5fdb5a61dc
2 changed files with 7 additions and 3 deletions

View File

@ -47,8 +47,12 @@ class ContactLoginController extends Controller
}
if (!$company && strpos($request->getHost(), 'invoicing.co') !== false) {
if($company){
$account = $company->account;
}
elseif (!$company && strpos($request->getHost(), 'invoicing.co') !== false) {
$subdomain = explode('.', $request->getHost())[0];
nlog("subdomain = {$subdomain}");
MultiDB::findAndSetDbByDomain(['subdomain' => $subdomain]);

View File

@ -110,14 +110,14 @@
document.getElementById('handlePlanChange').addEventListener('click', function() {
if(document.getElementById("newPlan").value.length > 1)
location.href = 'http://devhosted.test:8000/client/subscriptions/{{ $current_recurring_id }}/plan_switch/' + document.getElementById("newPlan").value + '';
location.href = 'https://invoiceninja.invoicing.co/client/subscriptions/{{ $current_recurring_id }}/plan_switch/' + document.getElementById("newPlan").value + '';
});
@else
document.getElementById('handleNewPlan').addEventListener('click', function() {
if(document.getElementById("newPlan").value.length > 1)
location.href = 'http://devhosted.test:8000/client/subscriptions/' + document.getElementById("newPlan").value + '/purchase';
location.href = 'https://invoiceninja.invoicing.co/client/subscriptions/' + document.getElementById("newPlan").value + '/purchase';
});
@endif