Add consistent CSRF token verification to API endpoints; address security concern with non-CSRF protected endpoints
This commit is contained in:
parent
cc31a0a6d0
commit
bf9cbe2c6d
7 changed files with 59 additions and 14 deletions
|
@ -70,7 +70,11 @@
|
|||
@parent
|
||||
<script>
|
||||
$('#configTokenBtn').on('click', function (event) {
|
||||
$.getJSON('{{ route('admin.nodes.view.configuration.token', $node->id) }}').done(function (data) {
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '{{ route('admin.nodes.view.configuration.token', $node->id) }}',
|
||||
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
|
||||
}).done(function (data) {
|
||||
swal({
|
||||
type: 'success',
|
||||
title: 'Token created.',
|
||||
|
|
Reference in a new issue