diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller')
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/ConfigController.php | 28 |
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 |