add csrf token header to jquery requests
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
<meta name="robots" content="noindex, nofollow, noarchive"/>
|
||||
<meta name="googlebot" content="nosnippet"/>
|
||||
<link rel="icon" type="image/x-icon" href="{{ basehref|default('') }}templates/Froxlor/assets/img/icon.png">
|
||||
<meta name="csrf-token" content="{{ csrf_token }}" />
|
||||
|
||||
<!-- CSS -->
|
||||
{% if theme_css is empty %}
|
||||
|
||||
@@ -11,6 +11,12 @@ window.Chart = Chart;
|
||||
$(function () {
|
||||
window.$theme = 'Froxlor';
|
||||
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
}
|
||||
});
|
||||
|
||||
const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
|
||||
const tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
|
||||
return new bootstrap.Tooltip(tooltipTriggerEl)
|
||||
|
||||
Reference in New Issue
Block a user