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, cache: true,
contentType: 'application/json', contentType: 'application/json',
dataType: 'json', dataType: 'json',
ajaxOptions: {}, ajaxOptions: {
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
},
queryParams: function (params) { queryParams: function (params) {
return params; return params;
}, },

View file

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