diff options
author | Kevin Decherf <kevin@kdecherf.com> | 2019-06-05 18:32:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-05 18:32:21 +0200 |
commit | 2b04b300f83cd4bb288c1fd00e2b77ec4f557a00 (patch) | |
tree | a877d48e7d7eb38965e959e860404e59164e9efb /src/Wallabag/CoreBundle/Controller/ConfigController.php | |
parent | 757ca53f6326a9b31c9f2f8508fc432e42ecf9c5 (diff) | |
parent | c4bf12aadee9e1f757fd9d783b034bb57b03fb17 (diff) | |
download | wallabag-2b04b300f83cd4bb288c1fd00e2b77ec4f557a00.tar.gz wallabag-2b04b300f83cd4bb288c1fd00e2b77ec4f557a00.tar.zst wallabag-2b04b300f83cd4bb288c1fd00e2b77ec4f557a00.zip |
Merge pull request #3994 from wallabag/feature/revoke-feed-token
Add ability to revoke feed token
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/ConfigController.php')
-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 |