Preview: VerifyCsrfToken.php
Size: 1001 B
/var/www/multi-event-cfp.bitkit.dk/httpdocs/app/Http/Middleware/VerifyCsrfToken.php
<?php
namespace App\Http\Middleware;
use Illuminate\Contracts\Encryption\DecryptException;
use Illuminate\Cookie\CookieValuePrefix;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
class VerifyCsrfToken extends Middleware
{
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
'hooks/adobe/agreement/completed',
'hooks/sendgrid/events'
];
protected function getTokenFromRequest($request)
{
$token = $request->input('_token') ?: $request->header('X-CSRF-TOKEN') ?: request()->cookie('XSRF-TOKEN');
if (!$token && $header = $request->header('X-XSRF-TOKEN') ?: request()->cookie('XSRF-TOKEN')) {
try {
$token = CookieValuePrefix::remove($this->encrypter->decrypt($header, static::serialized()));
} catch (DecryptException $e) {
$token = '';
}
}
return $token;
}
}
Directory Contents
Dirs: 0 × Files: 11