Fixes for client password reset

This commit is contained in:
David Bomba 2021-12-10 14:00:22 +11:00
parent ac194665de
commit 1186eaa823

View File

@ -93,14 +93,15 @@ class ContactForgotPasswordController extends Controller
public function sendResetLinkEmail(ContactPasswordResetRequest $request) public function sendResetLinkEmail(ContactPasswordResetRequest $request)
{ {
if(Ninja::isHosted() && $request->has('company_key'))
if(Ninja::isHosted() && $request->session()->has('company_key')) MultiDB::findAndSetDbByCompanyKey($request->input('company_key'));
MultiDB::findAndSetDbByCompanyKey($request->session()->get('company_key'));
$this->validateEmail($request); $this->validateEmail($request);
$company = Company::where('company_key', $request->session()->get('company_key'))->first(); // $company = Company::where('company_key', $request->input('company_key'))->first();
$contact = ClientContact::where(['company_id' => $company->id, 'email' => $request->input('email')])->first(); // $contact = ClientContact::where(['company_id' => $company->id, 'email' => $request->input('email')])->first();
$contact = ClientContact::where(['email' => $request->input('email')])->first();
$response = false; $response = false;
@ -117,7 +118,7 @@ class ContactForgotPasswordController extends Controller
return $this->sendResetLinkFailedResponse($request, Password::INVALID_USER); return $this->sendResetLinkFailedResponse($request, Password::INVALID_USER);
// We will send the password reset link to this user. Once we have attempted // We will send the password reset link to this user. Once we have attempted
// to send the link, we will examine the response then see the message we // to send the link, we will examine thuser@example.ce response then see the message we
// need to show to the user. Finally, we'll send out a proper response. // need to show to the user. Finally, we'll send out a proper response.
// $response = $this->broker()->sendResetLink( // $response = $this->broker()->sendResetLink(
// $this->credentials($request) // $this->credentials($request)