invoiceninja/app/Http/Middleware/VerifyCsrfToken.php

48 lines
1.1 KiB
PHP
Raw Normal View History

2018-10-04 20:10:43 +03:00
<?php
2019-05-11 13:32:07 +10:00
/**
* Invoice Ninja (https://invoiceninja.com).
2019-05-11 13:32:07 +10:00
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
2022-04-27 13:20:41 +10:00
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
2019-05-11 13:32:07 +10:00
*
2021-06-16 16:58:16 +10:00
* @license https://www.elastic.co/licensing/elastic-license
2019-05-11 13:32:07 +10:00
*/
2018-10-04 20:10:43 +03:00
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
2022-01-15 15:07:40 +11:00
use Illuminate\Session\TokenMismatchException;
2018-10-04 20:10:43 +03:00
class VerifyCsrfToken extends Middleware
{
/**
* Indicates whether the XSRF-TOKEN cookie should be set on the response.
*
* @var bool
*/
protected $addHttpCookie = true;
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
2021-06-02 18:55:33 +10:00
// 'livewire/message/*'
2018-10-04 20:10:43 +03:00
];
2022-01-15 15:07:40 +11:00
2022-01-15 20:49:40 +11:00
// public function handle($request, \Closure $next) {
2022-01-15 15:07:40 +11:00
2022-01-15 20:49:40 +11:00
// try {
// return parent::handle($request, $next);
// } catch (TokenMismatchException $ex) {
2022-01-15 15:07:40 +11:00
2022-01-15 20:49:40 +11:00
// throw new TokenMismatchException('CSRF token mismatch.');
2022-01-15 15:07:40 +11:00
2022-01-15 20:49:40 +11:00
// }
// }
2022-01-15 15:07:40 +11:00
2018-10-04 20:10:43 +03:00
}