Confirm.

@return the response
518938
@Path("confirm")
    @GET
    @Produces({ MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN })
    @SuppressWarnings("checkstyle:illegalcatch")
    public Response confirm()
    {
        Response ret = null;
        try {
            final Context context = Context.getThreadContext();
            final ContextReply reply = new ContextReply()
                            .setUserName(context.getPerson().getName())
                            .setUserLastName(context.getPerson().getLastName())
                            .setUserFirstName(context.getPerson().getFirstName())
                            .setCompanyName(context.getCompany().getName())
                            .setLocale(context.getLocale().toString());

            ret = Response.ok().type(MediaType.APPLICATION_JSON).entity(getJSONReply(reply)).build();
        } catch (final Exception e) {
            RestContext.LOG.error("Error processing data.", e);
            final ErrorReply reply = new ErrorReply()
                            .setError(e.getClass().getName())
                            .setMessage(e.getMessage())
                            .setStacktrace(ExceptionUtils.getStackTrace(e));
            ret = Response.serverError().type(MediaType.APPLICATION_JSON).entity(getJSONReply(reply)).build();
        }
        return ret;
    }
558697
def confirmation(self, apdu):
        """"""
        if _debug: ClientSSM._debug("confirmation %r", apdu)

        if self.state == SEGMENTED_REQUEST:
            self.segmented_request(apdu)
        elif self.state == AWAIT_CONFIRMATION:
            self.await_confirmation(apdu)
        elif self.state == SEGMENTED_CONFIRMATION:
            self.segmented_confirmation(apdu)
        else:
            raise RuntimeError("invalid state")
1105853
public function confirmResetPassword()
    {
        $errorMessage = null;

        $login = Common::getRequestVar('login', '');
        $resetToken = Common::getRequestVar('resetToken', '');

        try {
            $this->passwordResetter->confirmNewPassword($login, $resetToken);
        } catch (Exception $ex) {
            Log::debug($ex);

            $errorMessage = $ex->getMessage();
        }

        if (is_null($errorMessage)) { // if success, show login w/ success message
            return $this->resetPasswordSuccess();
        } else {
            // show login page w/ error. this will keep the token in the URL
            return $this->login($errorMessage);
        }
    }
395298
public function confirmInformationAction()
    {
        $accountInfo = $this->checkAccountInformation();

        if ($accountInfo) {
            return $accountInfo;
        }

        $this->title("Confirm Information");
        return $this->render("steps/confirm_information.phtml");
    }
963118
def confirm(self, token=None):
        
        _token = token if token else self._response.get("token")
        return self._process('checkout-invoice/confirm/' + str(_token))
1221650
protected Response post() {
        RequestBuilder builder = RequestBuilder.post().setUri(url);
        return getResponseAfterDetectingType(builder);
    }
1004334
function getConfirmation(terria, viewState, confirmConversion, message) {
  if (!confirmConversion) {
    return when(true);
  }

  var d = when.defer(); // there's no `when.promise(resolver)` in when 1.7.1
  viewState.notifications.push({
    confirmText: "Upload",
    denyText: "Cancel",
    title: "Use conversion service?",
    message: message,
    confirmAction: function() {
      d.resolve(true);
    },
    denyAction: function() {
      d.resolve(false);
    }
  });
  return d.promise;
}
939243
def handleConfirm(page, message)
      val = @procs[:confirm].map { |handler| handler.call(page, message) }.last
      val.nil? || !!val
    end
74623
public function sendDatasConfirmAction()
    {
        $ds = DIRECTORY_SEPARATOR;
        $platformOptionsFile = $this->container->getParameter('kernel.root_dir') .
            $ds . 'config' . $ds . 'platform_options.yml';

        if (is_null($this->configHandler->getParameter('token'))) {
            $token = $this->generateToken(20);
            $this->configHandler->setParameter('token', $token);
        }
        $this->sendDatas();

        $this->configHandler->setParameter('confirm_send_datas', 'OK');

        return new RedirectResponse(
            $this->router->generate('claro_admin_parameters_index')
        );
    }
819966
public function confirm()
    {
        Yii::$app->get('hiart')->disableAuth();
        try {
            $confirmation = Contact::perform('confirm-email', [
                'confirm_data' => Yii::$app->request->get(),
            ]);

            return [
                'success' => true,
            ];
        } catch (\hiqdev\hiart\ResponseErrorException $e) {
            return [
                'success' => false,
                'message' => $e->getMessage(),
            ];
        }
    }
645186
public function handleConfirmation($request)
    {
        // Find the action handler
        $action = $request->param('BatchAction');
        $actionHandler = $this->actionByName($action);

        // Sanitise ID list and query the database for apges
        $csvIDs = $request->requestVar('csvIDs');
        $ids = $this->cleanIDs($csvIDs);

        // Check dialog
        if ($actionHandler->hasMethod('confirmationDialog')) {
            $response = new HTTPResponse(json_encode($actionHandler->confirmationDialog($ids)));
        } else {
            $response = new HTTPResponse(json_encode(array('alert' => false)));
        }

        $response->addHeader("Content-type", "application/json");
        return $response;
    }
256482
@POST
    @Produces(MediaType.TEXT_PLAIN)
    @ApiOperation(
            value = "Assert login credentials",
            notes = "Upon a successful login, a JWT will be returned in the response. This functionality requires authentication to be enabled.",
            response = String.class
    )
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "Success"),
            @ApiResponse(code = 401, message = "Unauthorized")
    })
    @AuthenticationNotRequired
    public Response validateCredentials(@FormParam("username") String username, @FormParam("password") String password) {
        final Authenticator auth = new Authenticator(username, password);
        try {
            final Principal principal = auth.authenticate();
            if (principal != null) {
                LOGGER.info(SecurityMarkers.SECURITY_AUDIT, "Login succeeded (username: " + username
                        + " / ip address: " + super.getRemoteAddress()
                        + " / agent: " + super.getUserAgent() + ")");

                final JsonWebToken jwt = new JsonWebToken();
                final String token = jwt.createToken(principal);
                return Response.ok(token).build();
            }
        } catch (AuthenticationException e) {
            LOGGER.warn(SecurityMarkers.SECURITY_AUDIT, "Unauthorized login attempt (username: "
                    + username + " / ip address: " + super.getRemoteAddress()
                    + " / agent: " + super.getUserAgent() + ")");
        }
        return Response.status(Response.Status.UNAUTHORIZED).build();
    }
1227190
public function getConfirmation()
    {
        $cAttribute = $this->confirmationAttribute;
        return (is_string($cAttribute) && !empty($cAttribute)) ? $this->$cAttribute : null;
    }
432753
private void confirmAndForceQuitAction(final Long actionId) {
        /* Display the confirmation */
        final ConfirmationDialog confirmDialog = new ConfirmationDialog(
                i18n.getMessage("caption.forcequit.action.confirmbox"),
                i18n.getMessage("message.forcequit.action.confirm"), i18n.getMessage(UIMessageIdProvider.BUTTON_OK),
                i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL), ok -> {
                    if (!ok) {
                        return;
                    }
                    final boolean cancelResult = forceQuitActiveAction(actionId);
                    if (cancelResult) {
                        populateAndUpdateTargetDetails(selectedTarget);
                        notification.displaySuccess(i18n.getMessage("message.forcequit.action.success"));
                    } else {
                        notification.displayValidationError(i18n.getMessage("message.forcequit.action.failed"));
                    }
                }, FontAwesome.WARNING, UIComponentIdProvider.CONFIRMATION_POPUP_ID, null);
        UI.getCurrent().addWindow(confirmDialog.getWindow());

        confirmDialog.getWindow().bringToFront();
    }
920890
private boolean responseIsInValid() {
        if (response == null) {
            return true;
        }
        else if (!response.isHeadless() && validityCheck) {
            return request.getTransactionID() != response.getTransactionID();
        }
        else {
            return false;
        }
    }
861483
public function httpPostDeleteForHtml()
    {
        $isConfirmed = $this->getRequest()->getParameter('confirm') == 1;

        $response = null;
        if ($isConfirmed) {
            // If the operation has been confirmed, proceed.
            $response = $this->getDeletionResponse(
                $this->getRequest()->getParameter('ids')
            );
        } else {
            // If the operation is not confirmed, request confirmation.
            $selectedIds = $this->getSelectedIds();
            $response = $this->getDeletionConfirmationResponse($selectedIds);
        }

        return $response;
    }
1211600
def confirms(self, txid):
        """"""
        txid = deserialize.txid(txid)
        return self.service.confirms(txid)