VisualBean
3/4/2018 - 8:57 PM

VueResource Interceptor for Unauthorized responses from external api's

VueResource Interceptor for Unauthorized responses from external api's

Vue.http.interceptors.push((request, next) => {
  next((response) => {
    if (response.status === 401) {
      router.push({ path: '/login' });
    }
  });
});