Move interceptor to common interceptors files
This commit is contained in:
parent
d5a223bdec
commit
daf5edf7ba
|
@ -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();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue