summaryrefslogtreecommitdiff
path: root/src/store
diff options
context:
space:
mode:
Diffstat (limited to 'src/store')
-rw-r--r--src/store/api.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/store/api.js b/src/store/api.js
index 04caea12..4918d804 100644
--- a/src/store/api.js
+++ b/src/store/api.js
@@ -1,4 +1,5 @@
import Axios from 'axios';
+import router from '../router';
const api = Axios.create({
withCredentials: true
@@ -6,10 +7,15 @@ const api = Axios.create({
api.interceptors.response.use(undefined, error => {
let response = error.response;
+
// TODO: Provide user with a notification and way to keep system active
if (response.status == 401) {
window.location = '/login';
}
+
+ if (response.status == 403) {
+ router.push({ name: 'unauthorized' });
+ }
});
export default {