X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FController%2FConfigController.php;h=cea4130317e7ebfea4afc1430534718f7b939642;hb=c4bf12aadee9e1f757fd9d783b034bb57b03fb17;hp=3b281d488ececf68fd0362f1d9ab3a98862cf71f;hpb=7e5b7e029a5ba7aadc8128243afaa00e2a870645;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index 3b281d48..cea41303 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -299,6 +299,34 @@ class ConfigController extends Controller return $this->redirect($this->generateUrl('config') . '#set2'); } + /** + * @param Request $request + * + * @Route("/revoke-token", name="revoke_token") + * + * @return RedirectResponse|JsonResponse + */ + public function revokeTokenAction(Request $request) + { + $config = $this->getConfig(); + $config->setFeedToken(null); + + $em = $this->getDoctrine()->getManager(); + $em->persist($config); + $em->flush(); + + if ($request->isXmlHttpRequest()) { + return new JsonResponse(); + } + + $this->addFlash( + 'notice', + 'flashes.config.notice.feed_token_revoked' + ); + + return $this->redirect($this->generateUrl('config') . '#set2'); + } + /** * Deletes a tagging rule and redirect to the config homepage. *