aboutsummaryrefslogtreecommitdiff
path: root/src/main.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.ts')
-rw-r--r--src/main.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.ts b/src/main.ts
index 56ab8a3..f4c9923 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -6,7 +6,6 @@ import axios from 'axios'
import 'vue-toast-notification/dist/theme-sugar.css'
import './assets/main.scss'
-
axios.defaults.baseURL = '/api'
axios.defaults.headers.post['Content-Type'] = 'application/json'
@@ -48,6 +47,10 @@ axios.interceptors.response.use(
}
}
+ if (originalConfig.url === "/auth/refresh" && err.response.status === 401) {
+ router.push(`/login?redirect=${router.currentRoute.value.fullPath}&reason=session_expired`)
+ }
+
return Promise.reject(err)
}
)