Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fixes for client password reset
  • Loading branch information
turbo124 committed Dec 10, 2021
1 parent ac19466 commit 1186eaa
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions app/Http/Controllers/Auth/ContactForgotPasswordController.php
Expand Up @@ -93,14 +93,15 @@ public function broker()

public function sendResetLinkEmail(ContactPasswordResetRequest $request)
{

if(Ninja::isHosted() && $request->session()->has('company_key'))
MultiDB::findAndSetDbByCompanyKey($request->session()->get('company_key'));
if(Ninja::isHosted() && $request->has('company_key'))
MultiDB::findAndSetDbByCompanyKey($request->input('company_key'));

$this->validateEmail($request);

$company = Company::where('company_key', $request->session()->get('company_key'))->first();
$contact = ClientContact::where(['company_id' => $company->id, 'email' => $request->input('email')])->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(['email' => $request->input('email')])->first();

$response = false;

Expand All @@ -117,7 +118,7 @@ public function sendResetLinkEmail(ContactPasswordResetRequest $request)
return $this->sendResetLinkFailedResponse($request, Password::INVALID_USER);

// 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.
// $response = $this->broker()->sendResetLink(
// $this->credentials($request)
Expand Down

0 comments on commit 1186eaa

Please sign in to comment.