/** * @param Request $request * @param null|AuthenticationException $authException * @return Response */ public function start(Request $request, AuthenticationException $authException = null) { $action = $this->config['login_action']; $manager = $this->factory->getManager($this->config['manager'], $request->getUriForPath($this->config['check_path'])); if ($action) { return $this->httpKernel->forward($action, array('manager' => $manager, 'request' => $request, 'exception' => $authException)); } return new RedirectResponse($manager->getServer()->getLoginUrl()); }
/** * @param Request $request * @param null|AuthenticationException $authException * @return Response */ public function start(Request $request, AuthenticationException $authException = null) { $action = $this->config['login_action']; $manager = $this->factory->getManager($this->config['manager'], $request->getUriForPath($this->config['check_path'])); if ($action) { $subRequest = $request->duplicate(null, null, array('_controller' => $action, 'manager' => $manager, 'request' => $request, 'exception' => $authException)); return $this->httpKernel->handle($subRequest, HttpKernelInterface::SUB_REQUEST); } return new RedirectResponse($manager->getServer()->getLoginUrl()); }