handle unauthorized access

parent 11f2e894
...@@ -31310,6 +31310,17 @@ var app = new _vue2.default({ ...@@ -31310,6 +31310,17 @@ var app = new _vue2.default({
i18n: i18n i18n: i18n
}); });
window.axios.interceptors.response.use(null, function (error) {
if (error.response.status === 401) {
app.$notify.error({
title: 'Unauthorized',
message: app.$t('core.unauthorized-access')
});
window.location = route('dashboard.index');
}
return Promise.reject(error);
});
/***/ }), /***/ }),
/* 39 */ /* 39 */
/***/ (function(module, __webpack_exports__, __webpack_require__) { /***/ (function(module, __webpack_exports__, __webpack_require__) {
...@@ -42,3 +42,14 @@ const app = new Vue({ ...@@ -42,3 +42,14 @@ const app = new Vue({
router, router,
i18n, i18n,
}); });
window.axios.interceptors.response.use(null, function(error) {
if (error.response.status === 401) {
app.$notify.error({
title: 'Unauthorized',
message: app.$t('core.unauthorized-access'),
});
window.location = route('dashboard.index')
}
return Promise.reject(error);
});
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