validated(); $response = $broker->sendResetLink($credentials); return $response === Password::RESET_LINK_SENT ? $this->sendRecoveryLinkResponse($request, $response) : $this->sendRecoveryLinkFailedResponse($request, $response); } /** * Get the response for a failed account recovery link. * * @return \Illuminate\Http\JsonResponse * * @throws \Illuminate\Validation\ValidationException */ protected function sendRecoveryLinkFailedResponse(Request $request, string $response) { throw ValidationException::withMessages(['email' => [trans($response)]]); } /** * Get the response for a successful account recovery link. * * @return \Illuminate\Http\JsonResponse */ protected function sendRecoveryLinkResponse(Request $request, string $response) { return response()->json(['message' => __('auth.webauthn.account_recovery_email_sent')]); } }