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'
import APIUtil from './util/apiutil'
import WAPITransactionSerice from './api-services/transaction.service'
import LoginService from '@/api-services/login.service'
Vue.use(Vuex)
Vue.mixin(titleMixin)
......@@ -255,16 +256,18 @@ Axios.interceptors.response.use(
function (response) {
return response;
},
function (error) {
async function (error) {
// handle error
if (error.response) {
var stat = error.response.status
switch (stat) {
case 401:
await LoginService.logout(null)
store.commit('logout')
router.push('/login')
break;
case 403:
await LoginService.logout(null)
store.commit('logout')
router.push('/login')
break;
......
Supports Markdown
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