Commit daf5edf7 authored by Filipa Lacerda's avatar Filipa Lacerda

Move interceptor to common interceptors files

parent d5a223bd
......@@ -13,3 +13,11 @@ Vue.http.interceptors.push((request, next) => {
Vue.activeResources--;
});
});
Vue.http.interceptors.push((request, next) => {
// needed in order to not break the tests.
if ($.rails) {
request.headers['X-CSRF-Token'] = $.rails.csrfToken();
}
next();
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment