Cleanup unnecessary CSRF tokens passed

This commit is contained in:
emanuele-f 2020-05-08 12:55:36 +02:00
parent 53e276e283
commit af842e4aa6
17 changed files with 7 additions and 36 deletions

View file

@ -476,7 +476,7 @@ print(
print[[
<script>
let import_csrf = ']] print(ntop.getRandomCSRFValue()) print[[';
const import_csrf = ']] print(ntop.getRandomCSRFValue()) print[[';
$('#import-modal-btn').on("click", function(e) {
@ -522,8 +522,6 @@ print[[
$("#import-error").text("]] print(i18n("request_failed_message")) print [[" + xhr.statusText).show();
if (!d.success) {
$("#import-error").text(d.error).show();
// update token
import_csrf = d.csrf;
} else {
location.reload();
}

View file

@ -16,6 +16,6 @@ end
ntop.serviceRestart()
res = { csrf = ntop.getRandomCSRFValue() }
res = { }
print(json.encode(res, nil, 1))