Skip to content

Commit

Permalink
check for validate csrf token middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Apr 21, 2023
1 parent 121a2c3 commit bbcb052
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Http/Middleware/EnsureFrontendRequestsAreStateful.php
Expand Up @@ -19,7 +19,7 @@ public function handle($request, $next)
{
$this->configureSecureCookieSessions();

return (new Pipeline(app()))->send($request)->through(static::fromFrontend($request) ? [
return (new Pipeline(app()))->send($request)->through(static::fromFrontend($request) ? array_values(array_unique([
function ($request, $next) {
$request->attributes->set('sanctum', true);

Expand All @@ -28,8 +28,9 @@ function ($request, $next) {
config('sanctum.middleware.encrypt_cookies', \Illuminate\Cookie\Middleware\EncryptCookies::class),
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
config('sanctum.middleware.validate_csrf_token', \Illuminate\Foundation\Http\Middleware\VerifyCsrfToken::class),
config('sanctum.middleware.verify_csrf_token', \Illuminate\Foundation\Http\Middleware\VerifyCsrfToken::class),
] : [])->then(function ($request) use ($next) {
])) : [])->then(function ($request) use ($next) {
return $next($request);
});
}
Expand Down

0 comments on commit bbcb052

Please sign in to comment.