class ResetPasswordController extends Controller
{
- protected LoginService $loginService;
-
- public function __construct(LoginService $loginService)
- {
+ public function __construct(
+ protected LoginService $loginService
+ ) {
$this->middleware('guest');
$this->middleware('guard:standard');
-
- $this->loginService = $loginService;
}
/**
// redirect them back to where they came from with their error message.
return $response === Password::PASSWORD_RESET
? $this->sendResetResponse()
- : $this->sendResetFailedResponse($request, $response);
+ : $this->sendResetFailedResponse($request, $response, $request->get('token'));
}
/**
/**
* Get the response for a failed password reset.
*/
- protected function sendResetFailedResponse(Request $request, string $response): RedirectResponse
+ protected function sendResetFailedResponse(Request $request, string $response, string $token): RedirectResponse
{
// We show invalid users as invalid tokens as to not leak what
// users may exist in the system.
$response = Password::INVALID_TOKEN;
}
- return redirect()->back()
+ return redirect("/password/reset/{$token}")
->withInput($request->only('email'))
->withErrors(['email' => trans($response)]);
}