From d35e7d81189c84d073cfab5481c2005d5bfec12a Mon Sep 17 00:00:00 2001 From: Pedro Cunha Date: Tue, 3 Dec 2024 23:12:51 +0000 Subject: [PATCH] fix: fix csrf token in ajax requests --- resources/views/layouts/master.blade.php | 6 ++++++ resources/views/modpack/view.blade.php | 10 ++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/resources/views/layouts/master.blade.php b/resources/views/layouts/master.blade.php index 2a254be8..934f9d62 100644 --- a/resources/views/layouts/master.blade.php +++ b/resources/views/layouts/master.blade.php @@ -24,6 +24,7 @@ + @yield('top') @@ -150,6 +151,11 @@ (function ($) { $(function () { $.jGrowl.defaults.closerTemplate = '
Close All
'; + $.ajaxSetup({ + headers: { + 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') + } + }); }); })(jQuery); diff --git a/resources/views/modpack/view.blade.php b/resources/views/modpack/view.blade.php index 01727d98..aa7d850e 100644 --- a/resources/views/modpack/view.blade.php +++ b/resources/views/modpack/view.blade.php @@ -93,7 +93,6 @@ class="btn btn-danger btn-xs" @endsection @section('bottom') @endsection