summaryrefslogtreecommitdiffstats
path: root/Core/Exception
diff options
context:
space:
mode:
authorJeremy Mikola <jmikola@gmail.com>2012-02-06 14:54:38 -0500
committerJeremy Mikola <jmikola@gmail.com>2012-02-14 19:03:52 -0500
commitdc06bea6d334604e95f5f050cfe9866e5ed4cde7 (patch)
tree0ce7370fb59b115767b1cfc899143e82fffe35b0 /Core/Exception
parent0924bcd2ebc4ec0ad510aea6df4034bb2e716c03 (diff)
downloadsymfony-security-dc06bea6d334604e95f5f050cfe9866e5ed4cde7.zip
symfony-security-dc06bea6d334604e95f5f050cfe9866e5ed4cde7.tar.gz
symfony-security-dc06bea6d334604e95f5f050cfe9866e5ed4cde7.tar.bz2
[Security] Use LogoutException for invalid CSRF token in LogoutListener
On the advice of @schmittjoh, this commit adds a LogoutException class for use by LogoutListener if the CSRF token is invalid. The handling in the Security component's ExceptionListener is modeled after AccessDeniedException, which gets wrapped in an AccessDeniedHttpException in the absence of handler service or error page (I didn't think it was appropriate to re-use those for LogoutException).
Diffstat (limited to 'Core/Exception')
-rw-r--r--Core/Exception/LogoutException.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/Core/Exception/LogoutException.php b/Core/Exception/LogoutException.php
new file mode 100644
index 0000000..2bb954f
--- /dev/null
+++ b/Core/Exception/LogoutException.php
@@ -0,0 +1,25 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Security\Core\Exception;
+
+/**
+ * LogoutException is thrown when the account cannot be logged out.
+ *
+ * @author Jeremy Mikola <jmikola@gmail.com>
+ */
+class LogoutException extends \RuntimeException
+{
+ public function __construct($message = 'Logout Exception', \Exception $previous = null)
+ {
+ parent::__construct($message, 403, $previous);
+ }
+}