Skip to content

Commit

Permalink
LP-4 password reset with mobile email and login_id function added
Browse files Browse the repository at this point in the history
  • Loading branch information
hafijul233 committed Oct 21, 2023
1 parent 5c85616 commit 26567ad
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Http/Controllers/PasswordResetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Fintech\Auth\Facades\Auth;
use Fintech\Auth\Http\Requests\ForgotPasswordRequest;
use Fintech\Auth\Http\Requests\PasswordResetRequest;
use Fintech\Auth\Traits\GuessAuthFieldTrait;
use Fintech\Core\Exceptions\UpdateOperationException;
use Fintech\Core\Traits\ApiResponseTrait;
use Illuminate\Http\JsonResponse;
Expand All @@ -13,6 +14,7 @@
class PasswordResetController extends Controller
{
use ApiResponseTrait;
use GuessAuthFieldTrait;

/**
* @lrd:start
Expand All @@ -28,11 +30,7 @@ public function store(ForgotPasswordRequest $request): JsonResponse
{
try {

$authField = config('fintech.auth.auth_field', 'login_id');

$authFieldValue = $request->input($authField);

$attemptUser = Auth::user()->list([$authField => $authFieldValue]);
$attemptUser = Auth::user()->list($this->getAuthFieldFromInput($request));

if ($attemptUser->isEmpty()) {
return $this->failed(__('auth::messages.failed'));
Expand Down Expand Up @@ -92,4 +90,5 @@ public function update(PasswordResetRequest $request): JsonResponse
return $this->failed($exception->getMessage());
}
}

}

0 comments on commit 26567ad

Please sign in to comment.