Commit 5f731c55 authored by janis.streib's avatar janis.streib 🦉
Browse files

UPD: invalidate session on (expired?) token

parent dd57520d
Pipeline #95395 passed with stages
in 6 minutes and 56 seconds
...@@ -18,6 +18,7 @@ import vuexUndoRedo from './mixins/vuex-undo-redo' ...@@ -18,6 +18,7 @@ import vuexUndoRedo from './mixins/vuex-undo-redo'
import APIUtil from './util/apiutil' import APIUtil from './util/apiutil'
import WAPITransactionSerice from './api-services/transaction.service' import WAPITransactionSerice from './api-services/transaction.service'
import LoginService from '@/api-services/login.service'
Vue.use(Vuex) Vue.use(Vuex)
Vue.mixin(titleMixin) Vue.mixin(titleMixin)
...@@ -255,16 +256,18 @@ Axios.interceptors.response.use( ...@@ -255,16 +256,18 @@ Axios.interceptors.response.use(
function (response) { function (response) {
return response; return response;
}, },
function (error) { async function (error) {
// handle error // handle error
if (error.response) { if (error.response) {
var stat = error.response.status var stat = error.response.status
switch (stat) { switch (stat) {
case 401: case 401:
await LoginService.logout(null)
store.commit('logout') store.commit('logout')
router.push('/login') router.push('/login')
break; break;
case 403: case 403:
await LoginService.logout(null)
store.commit('logout') store.commit('logout')
router.push('/login') router.push('/login')
break; break;
......
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