summaryrefslogtreecommitdiff
path: root/src/Http/Exceptions/HttpAuthExpired.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-11-27 13:34:55 +0100
committermsquare <msquare@notrademark.de>2018-12-02 12:53:31 +0100
commit55beca95cd8d6ecfe610daea304c8374a10485af (patch)
treee84ca6064c3d3b6315e9c026b0a808f8e594d16a /src/Http/Exceptions/HttpAuthExpired.php
parent9788c5095a67a45fe3545ae0fc747b8e629ea4fd (diff)
Refactoring: Throw HttpAuthExpired on csrf token mismatch
Diffstat (limited to 'src/Http/Exceptions/HttpAuthExpired.php')
-rw-r--r--src/Http/Exceptions/HttpAuthExpired.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/Http/Exceptions/HttpAuthExpired.php b/src/Http/Exceptions/HttpAuthExpired.php
new file mode 100644
index 00000000..83ca240f
--- /dev/null
+++ b/src/Http/Exceptions/HttpAuthExpired.php
@@ -0,0 +1,24 @@
+<?php
+
+namespace Engelsystem\Http\Exceptions;
+
+use Throwable;
+
+class HttpAuthExpired extends HttpException
+{
+ /**
+ * @param string $message
+ * @param array $headers
+ * @param int $code
+ * @param Throwable|null $previous
+ */
+ public function __construct(
+ string $message = 'Authentication Expired',
+ array $headers = [],
+ int $code = 0,
+ Throwable $previous = null
+ ) {
+ // The 419 code is used as "Page Expired" to differentiate from a 401 (not authorized)
+ parent::__construct(419, $message, $headers, $code, $previous);
+ }
+}