render('WallabagImportBundle:Pocket:index.html.twig', array()); } /** * @Route("/import/pocket/auth", name="pocket_auth") */ public function authAction() { $pocket = $this->get('wallabag_import.pocket.import'); $authUrl = $pocket->oAuthRequest( $this->generateUrl('import', array(), true), $this->generateUrl('pocket_callback', array(), true) ); return $this->redirect($authUrl, 301); } /** * @Route("/import/pocket/callback", name="pocket_callback") */ public function callbackAction() { $pocket = $this->get('wallabag_import.pocket.import'); $accessToken = $pocket->oAuthAuthorize(); $pocket->import($accessToken); return $this->redirect($this->generateUrl('homepage')); } }