示例#1
0
 private function redisplayForm(array $error, CsrfToken $csrfToken, Request $request) : Response
 {
     $csrfToken->regenerateValue();
     $view = array_merge($this->config, ['error' => ['message' => json_encode($error)], 'action' => (string) $request->getOriginalRequest()->getUri(), 'csrf' => $csrfToken->getValue()]);
     return new HtmlResponse($this->template->render('contact.landing', $view));
 }
示例#2
0
 /**
  * Is Valid
  *
  * @param Request $request DESCRIPTION
  *
  * @return mixed
  *
  * @access protected
  */
 protected function isValid(Request $request)
 {
     $body = $request->getParsedBody();
     return $this->token->isValid(isset($body[$this->csrfKey]) ? $body[$this->csrfKey] : null);
 }