Fix CSRF issue on bootstrap tables

This commit is contained in:
snipe 2017-01-11 14:52:05 -08:00
parent 4940bf05f0
commit dbf3a074f7
2 changed files with 8 additions and 4 deletions

View file

@ -254,7 +254,11 @@
cache: true,
contentType: 'application/json',
dataType: 'json',
ajaxOptions: {},
ajaxOptions: {
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
},
queryParams: function (params) {
return params;
},

View file

@ -25,9 +25,7 @@
<link rel="shortcut icon" type="image/ico" href="{{ asset('favicon.ico') }}">
<script>
window.Laravel = { csrfToken: '{{ csrf_token() }}' };
</script>
<meta name="csrf-token" content="{{ csrf_token() }}">
<style>
@if ($snipeSettings)
@ -275,6 +273,7 @@
<!-- User Account: style can be found in dropdown.less -->
@if (Auth::check())
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
@if (Auth::user()->present()->gravatar())
@ -312,6 +311,7 @@
</li>
</ul>
</li>
@endif
@can('superadmin')