I get an Access Token from a social network help with HWIO Bundle and to redirect after service is called. I tried adding router to the service:
<argument type="service" id="router" />
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Security\Core\User\UserInterface;
class UserProvider implements OAuthAwareUserProviderInterface
{
protected $router;
public function __construct(RouterInterface $router)
{
$this->router = $router;
}
public function connect(UserInterface $user, UserResponseInterface $response)
{
$service = $response->getResourceOwner()->getName();
$serviceProvider = $service."Provider";
$user = $this->$serviceProvider->setUserData($user, $response);
$grabProject = $this->grabProject->grabProject($response->getAccessToken(), $user);
return new RedirectResponse($this->router->generate('application_frontend_default_index'));
}
after my action I turn in controller HWIO Bundle in connectServiceAction
public function connectServiceAction(Request $request, $service)
{
Maybe need overwrite this controller and action, how to make this?