I have some custom JS code that needs to perform AJAX POST requests.
Plone raises "Forbidden: Form authenticator is invalid." with plone.protect installed.
What is the correct way to get hold of the authenticator value and how to inject it into the POST request?
describes how to inject the authenticator into a form but there is no API documentation about how to get hold of the authenticator without the input field stuff.
Assuming that I can inject the authenticator value into the JS namespace: would I just add its value to the 'data' array?
$.ajax({
type: 'POST',
url: url,
data: {
subpath: SUBPATH,
old_id: title,
new_id: new_id
},
success: function(msg) {
alert('success' + msg);
refresh_table();
},
error: function(msg) {
alert('error' + msg);
}
});
-aj