Пример #1
0
 /**
  * @Route("/{userType}")
  * @Method({"POST"})
  *
  * @param Request $request
  *
  * @return Response
  */
 public function indexAction(Request $request, $userType)
 {
     // Generate a MAC value
     $mac = $this->macManager->generate()->getMac();
     // Cache the posted data using the MAC as its reference
     $this->cachePostedData($request, $mac);
     // Construct the response
     $response = array('url' => $this->getHandoffUrl($request, $userType, $mac));
     // Return a json encoded handoff url
     return new Response(json_encode($response, JSON_UNESCAPED_SLASHES));
 }