mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 01:14:34 -04:00
Fixes for logging in duplicate contact email addresses
This commit is contained in:
parent
3cf5ae9056
commit
2b80d3572a
@ -100,10 +100,18 @@ class ContactForgotPasswordController extends Controller
|
|||||||
|
|
||||||
if(Ninja::isHosted() && $company = Company::where('company_key', $request->input('company_key'))->first())
|
if(Ninja::isHosted() && $company = Company::where('company_key', $request->input('company_key'))->first())
|
||||||
{
|
{
|
||||||
$contact = ClientContact::where(['email' => $request->input('email'), 'company_id' => $company->id])->first();
|
$contact = ClientContact::where(['email' => $request->input('email'), 'company_id' => $company->id])
|
||||||
|
->whereHas('client', function ($query) {
|
||||||
|
$query->where('is_deleted',0);
|
||||||
|
})->first();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
$contact = ClientContact::where(['email' => $request->input('email')])
|
||||||
|
->whereHas('client', function ($query) {
|
||||||
|
$query->where('is_deleted',0);
|
||||||
|
})->first();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
$contact = ClientContact::where(['email' => $request->input('email')])->first();
|
|
||||||
|
|
||||||
$response = false;
|
$response = false;
|
||||||
|
|
||||||
|
@ -98,7 +98,10 @@ class ContactLoginController extends Controller
|
|||||||
|
|
||||||
if(Ninja::isHosted() && $request->has('password') && $company = Company::where('company_key', $request->input('company_key'))->first()){
|
if(Ninja::isHosted() && $request->has('password') && $company = Company::where('company_key', $request->input('company_key'))->first()){
|
||||||
|
|
||||||
$contact = ClientContact::where(['email' => $request->input('email'), 'company_id' => $company->id])->first();
|
$contact = ClientContact::where(['email' => $request->input('email'), 'company_id' => $company->id])
|
||||||
|
->whereHas('client', function ($query) {
|
||||||
|
$query->where('is_deleted',0);
|
||||||
|
})->first();
|
||||||
|
|
||||||
if(!$contact)
|
if(!$contact)
|
||||||
return $this->sendFailedLoginResponse($request);
|
return $this->sendFailedLoginResponse($request);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user