Response when reset password failed.

@param  string  $response

@return mixed
7476
public function passwordResetHasFailed($response)
    {
        $message = trans($response);
        $token = Request::input('token');

        return $this->redirectWithMessage(handles("orchestra::forgot/reset/{$token}"), $message, 'error');
    }
808354
public function packetResponse(array $response = null)
    {

        // Act as setter
        if (!empty($response)) {
            $this->packets_response = $response;
        }

        return $this->packets_response;
    }
301190
public static function failedCompletelyException($response)
    {
        $message = '';
        foreach ($response as $key => $item) {
            if ($item['status'] === 'error') {
                $message .= $key == 0? "" : "\r\n";
                $message .= $item['message'];
            }
        }

        return new static($message);
    }
459734
public function resetPassword()
    {
        // Retrieve received token
        $token = Input::get('token');

        // Validate token
        $resetToken = $this->resetPasswordRepository->getByUnexpiredToken($token);
        if (empty($resetToken)) {
            return view('nodes.api::reset-password.invalid');
        }

        // Retrieve received e-mail
        $email = Input::get('email');

        // Validate e-mail address
        if ($resetToken->email != $email) {
            return redirect()->back()->with(['email' => $email, 'error' => 'Token does not belong to e-mail address']);
        }

        // Retrieve passwords
        $password = Input::get('password');
        $repeatPassword = Input::get('repeat-password');

        // Validate passwords
        if ($password != $repeatPassword) {
            return redirect()->back()->with(['email' => $email, 'error' => 'The two passwords does not match each other']);
        }

        // All good! Update user's password
        $status = $this->resetPasswordRepository->updatePasswordByEmail($email, $password);
        if (empty($status)) {
            return redirect()->back()->with(['email' => $email, 'error' => 'Could not change user\'s password']);
        }

        // Mark token as used
        $resetToken->markAsUsed();

        return redirect()->route('nodes.api.auth.reset-password.done')->with('success', 'Password was successfully changed');
    }
1248642
public function getUserFromTokenResponse($response)
    {
        $user = $this->mapUserToObject($this->getUserByToken(
            $token = $this->parseAccessToken($response)
        ));

        $this->credentialsResponseBody = $response;

        if ($user instanceof User) {
            $user->setAccessTokenResponseBody($this->credentialsResponseBody);
        }

        return $user->setToken($token)
            ->setRefreshToken($this->parseRefreshToken($response))
            ->setExpiresIn($this->parseExpiresIn($response));
    }
1065864
private static function handleErrors($response)
    {
        switch ($response->getStatusCode()) {
            case 200:
                return json_decode($response->getBody());
                break;
            case 401:
                throw new UnauthorizedException('Unauthorized (Invalid API key or insufficient permissions)');
                break;
            case 404:
                throw new NotFoundException('Object not found within your account scope');
                break;
            case 406:
                throw new InvalidFormatException('Requested format is not supported - request JSON or XML only');
                break;
            case 422:
                throw new ValidationException('Validation error(s) for create or update method');
                break;
            case 500:
                throw new ServerException('Something went wrong on Challonge\'s end');
                break;
            default:
                $decodedResponse = json_decode($response->getBody());
                throw new UnexpectedErrorException($decodedResponse);
                break;
        }
    }
930661
public function detect($response)
    {
        if (stripos($response, '<error>') === false) {
            return $response;
        }

        $error = preg_replace('/^.*<error>([^<]+)<\/error>.*$/ims', '$1', $response);

        switch ($error) {
            case 'Banned':
                throw BannedException::banned();
            case 'Anime not found':
                throw NotFoundException::anime();
            default:
                throw ErrorException::error($error);
        }
    }
456618
protected function getValidPasswordReset($token)
    {
        $passwordResets = $this->passwordResetData->listEntries(['token' => $token]);
        if (count($passwordResets) !== 1) {
            return null;
        }
        $passwordReset = $passwordResets[0];

        $createdAt = $passwordReset->get('created_at');
        if (strtotime($createdAt.' UTC') < time() - 2 * 24 * 60 * 60 || $passwordReset->get('reset')) {
            return null;
        }

        return $passwordReset;
    }
14455
protected function IsSuccessResponse($response = '')
    {
        $bPaymentOk = false;
        $oGlobal = TGlobal::instance();
        if (empty($response)) {
            $aResult = $this->GetNeedeResponsePostParameterForSecurityCheck();
            $aResult['ret_status'] = $oGlobal->GetUserData('ret_status');
        } else {
            $aResult = $this->GetResultFormResponse($response);
        }

        if (count($aResult) > 0 && array_key_exists('ret_status', $aResult) && 'SUCCESS' == $aResult['ret_status']) {
            $bPaymentOk = true;
        }
        if ($bPaymentOk) {
            $bPaymentOk = $this->IsSecurityCheckOk($aResult['trxuser_id'], $aResult['trx_amount'], $aResult['trx_currency'], $aResult['ret_authcode'], $aResult['ret_trx_number'], $aResult['ret_param_checksum']);
        }

        return $bPaymentOk;
    }
724455
protected function sendResetLinkFailedResponse(Request $request, $response)
    {
        if ($request->expectsJson()) {
            return new JsonResponse([
                'message' =>  'The given data was invalid.',
                'errors' => [
                    'email' => trans($response)
                ]
            ], 422);
        }
        return back()->withErrors(
            ['email' => trans($response)]
        );
    }
557923
public static function failedToDecodeResponse(ResponseInterface $response, $error)
    {
        $response->getBody()->rewind();
        return new static(sprintf(
            "Failed to decode response '%s' with error '%s'",
            $response->getBody()->getContents(),
            $error
        ));
    }
549955
protected function responseWithHeaders($response)
    {
        foreach ($this->getHeaders() as $key => $value) {
            $response->headers->set($key, $value);
        }

        return $response;
    }
1329921
protected function getErrorCode($response)
    {
        $code = Arr::get($response['error'], 'code', 'PaymentException');
        if (!isset($this->errorCodeMap[$code])) {
            $code = 'PaymentException';
        }

        return new ErrorCode($this->errorCodeMap[$code]);
    }
189366
protected function getVerificationResult($response)
    {
        if (!isset($this->verificationResult[$response])) {
            $postFields = [
                'secret'   => $this->secretKey,
                'response' => $response,
            ];

            if ($this->ip) {
                $postFields['remoteip'] = $this->ip;
            }

            $handle = \curl_init(self::VERIFY_URL);

            \curl_setopt($handle, CURLOPT_POST, \count($postFields));
            \curl_setopt($handle, CURLOPT_POSTFIELDS, \http_build_query($postFields));
            \curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);

            \curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, 0);
            \curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, 0);

            $result = \curl_exec($handle);

            if (!$result || !\is_string($result)) {
                return [];
            }

            $this->verificationResult[$response] = \json_decode($result, true);
        }

        return $this->verificationResult[$response];
    }
1116303
protected function sendResetResponse(Request $request, $response): JsonResponse
    {
        $user = (new HCAuthorizeDTO(
            $this->user,
            $this->user->createToken('Personal Access Token'),
            $this->getUserConfig($this->user)
        ))->toArray();

        return $this->response->success(trans($response), $user);
    }
382881
public function getResponseId($response){
        $isError = $this->isError($response);

        if($isError){
            $result = array (
                'message' => $response->getMessage(),
                'eventId' => $response->getEventId()
            );

            return $result;

        } else {
            $result = array (
                'responseMessage' => $response->getResponseMessage(),
                'id' => $response->getId()
            );

            return $result;
        }
    }
1252506
protected function sendResetLinkFailedResponse(Request $request, $response)
    {
        return back()
                ->withInput($request->only('email'))
                ->withErrors(['email' => trans($response)]);
    }