2018-10-04 19:10:43 +02:00
|
|
|
<?php
|
2019-05-11 05:32:07 +02:00
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2019-05-11 05:32:07 +02:00
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2023-01-28 23:21:40 +01:00
|
|
|
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
2019-05-11 05:32:07 +02:00
|
|
|
*
|
2021-06-16 08:58:16 +02:00
|
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
2019-05-11 05:32:07 +02:00
|
|
|
*/
|
2018-10-04 19:10:43 +02:00
|
|
|
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
|
|
|
|
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
|
2022-01-15 05:07:40 +01:00
|
|
|
use Illuminate\Session\TokenMismatchException;
|
2018-10-04 19:10:43 +02: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 10:55:33 +02:00
|
|
|
// 'livewire/message/*'
|
2018-10-04 19:10:43 +02:00
|
|
|
];
|
2022-01-15 05:07:40 +01:00
|
|
|
|
2022-01-15 10:49:40 +01:00
|
|
|
// public function handle($request, \Closure $next) {
|
2022-01-15 05:07:40 +01:00
|
|
|
|
2022-01-15 10:49:40 +01:00
|
|
|
// try {
|
|
|
|
// return parent::handle($request, $next);
|
|
|
|
// } catch (TokenMismatchException $ex) {
|
2022-01-15 05:07:40 +01:00
|
|
|
|
2022-01-15 10:49:40 +01:00
|
|
|
// throw new TokenMismatchException('CSRF token mismatch.');
|
2022-01-15 05:07:40 +01:00
|
|
|
|
2022-01-15 10:49:40 +01:00
|
|
|
// }
|
|
|
|
// }
|
2018-10-04 19:10:43 +02:00
|
|
|
}
|