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

@ -55,8 +55,6 @@ elseif(action == "rename") then
if not success then
result.error = err
-- Can be used to trigger a new request
result.csrf = ntop.getRandomCSRFValue()
end
elseif(action == "clone") then
local new_name = _POST["confset_name"]
@ -71,8 +69,6 @@ elseif(action == "clone") then
if not success then
result.error = err
-- Can be used to trigger a new request
result.csrf = ntop.getRandomCSRFValue()
else
result.config_id = err
end
@ -99,15 +95,11 @@ elseif(action == "set_targets") then
if not success then
result.error = err
result.csrf = ntop.getRandomCSRFValue()
end
else
-- Validation error
result.success = false
result.error = err
-- Can be used to trigger a new request
result.csrf = ntop.getRandomCSRFValue()
end
else
traceError(TRACE_ERROR, TRACE_CONSOLE, "Unknown action '".. action .. "'")