feat: require csrf token if not using bearer token

This commit is contained in:
Julian Lam
2020-10-13 16:58:44 -04:00
parent 30b3fedca4
commit 1e07886f30
3 changed files with 10 additions and 1 deletions

View File

@@ -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);