mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 12:36:02 +01:00
feat: require csrf token if not using bearer token
This commit is contained in:
@@ -5,7 +5,11 @@ define('api', () => {
|
||||
const baseUrl = config.relative_path + '/api/v3';
|
||||
|
||||
function call(options, onSuccess, onError) {
|
||||
$.ajax(options)
|
||||
$.ajax(Object.assign({
|
||||
headers: {
|
||||
'x-csrf-token': config.csrf_token,
|
||||
},
|
||||
}, options))
|
||||
.done((res) => {
|
||||
if (onSuccess) {
|
||||
onSuccess(res.response);
|
||||
|
||||
Reference in New Issue
Block a user