mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #6438 from beganovich/v5-617
(v5) Auto-login on ACH verification email
This commit is contained in:
commit
728d077a94
@ -71,11 +71,16 @@ class ContactKeyLogin
|
|||||||
}
|
}
|
||||||
} elseif ($request->segment(2) && $request->segment(2) == 'key_login' && $request->segment(3)) {
|
} elseif ($request->segment(2) && $request->segment(2) == 'key_login' && $request->segment(3)) {
|
||||||
if ($client_contact = ClientContact::where('contact_key', $request->segment(3))->first()) {
|
if ($client_contact = ClientContact::where('contact_key', $request->segment(3))->first()) {
|
||||||
|
if(empty($client_contact->email)) {
|
||||||
if(empty($client_contact->email))
|
|
||||||
$client_contact->email = Str::random(6) . "@example.com"; $client_contact->save();
|
$client_contact->email = Str::random(6) . "@example.com"; $client_contact->save();
|
||||||
|
}
|
||||||
|
|
||||||
auth()->guard('contact')->login($client_contact, true);
|
auth()->guard('contact')->login($client_contact, true);
|
||||||
|
|
||||||
|
if ($request->query('next')) {
|
||||||
|
return redirect($request->query('next'));
|
||||||
|
}
|
||||||
|
|
||||||
return redirect()->to('client/dashboard');
|
return redirect()->to('client/dashboard');
|
||||||
}
|
}
|
||||||
} elseif ($request->has('client_hash') && config('ninja.db.multi_db_enabled')) {
|
} elseif ($request->has('client_hash') && config('ninja.db.multi_db_enabled')) {
|
||||||
@ -106,7 +111,6 @@ class ContactKeyLogin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -68,8 +68,15 @@ class ACH
|
|||||||
|
|
||||||
$client_gateway_token = $this->storePaymentMethod($source, $request->input('method'), $customer);
|
$client_gateway_token = $this->storePaymentMethod($source, $request->input('method'), $customer);
|
||||||
|
|
||||||
|
$verification = route('client.payment_methods.verification', ['payment_method' => $client_gateway_token->hashed_id, 'method' => GatewayType::BANK_TRANSFER], false);
|
||||||
|
|
||||||
$mailer = new NinjaMailerObject();
|
$mailer = new NinjaMailerObject();
|
||||||
$mailer->mailable = new ACHVerificationNotification(auth('contact')->user()->client->company, route('client.payment_methods.verification', ['payment_method' => $client_gateway_token->hashed_id, 'method' => GatewayType::BANK_TRANSFER]));
|
|
||||||
|
$mailer->mailable = new ACHVerificationNotification(
|
||||||
|
auth('contact')->user()->client->company,
|
||||||
|
route('client.contact_login', ['contact_key' => auth('contact')->user()->contact_key, 'next' => $verification])
|
||||||
|
);
|
||||||
|
|
||||||
$mailer->company = auth('contact')->user()->client->company;
|
$mailer->company = auth('contact')->user()->client->company;
|
||||||
$mailer->settings = auth('contact')->user()->client->company->settings;
|
$mailer->settings = auth('contact')->user()->client->company->settings;
|
||||||
$mailer->to_user = auth('contact')->user();
|
$mailer->to_user = auth('contact')->user();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user