aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller/ConfigController.php
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2019-06-05 17:55:13 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2019-06-05 17:55:13 +0200
commitc4bf12aadee9e1f757fd9d783b034bb57b03fb17 (patch)
tree30bd13c56866f6be1fa8aed65fd39b31b7a62ee9 /src/Wallabag/CoreBundle/Controller/ConfigController.php
parent7e5b7e029a5ba7aadc8128243afaa00e2a870645 (diff)
downloadwallabag-c4bf12aadee9e1f757fd9d783b034bb57b03fb17.tar.gz
wallabag-c4bf12aadee9e1f757fd9d783b034bb57b03fb17.tar.zst
wallabag-c4bf12aadee9e1f757fd9d783b034bb57b03fb17.zip
Add ability to revoke feed token
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/ConfigController.php')
-rw-r--r--src/Wallabag/CoreBundle/Controller/ConfigController.php28
1 files changed, 28 insertions, 0 deletions
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
@@ -300,6 +300,34 @@ class ConfigController extends Controller
300 } 300 }
301 301
302 /** 302 /**
303 * @param Request $request
304 *
305 * @Route("/revoke-token", name="revoke_token")
306 *
307 * @return RedirectResponse|JsonResponse
308 */
309 public function revokeTokenAction(Request $request)
310 {
311 $config = $this->getConfig();
312 $config->setFeedToken(null);
313
314 $em = $this->getDoctrine()->getManager();
315 $em->persist($config);
316 $em->flush();
317
318 if ($request->isXmlHttpRequest()) {
319 return new JsonResponse();
320 }
321
322 $this->addFlash(
323 'notice',
324 'flashes.config.notice.feed_token_revoked'
325 );
326
327 return $this->redirect($this->generateUrl('config') . '#set2');
328 }
329
330 /**
303 * Deletes a tagging rule and redirect to the config homepage. 331 * Deletes a tagging rule and redirect to the config homepage.
304 * 332 *
305 * @param TaggingRule $rule 333 * @param TaggingRule $rule