From ab65aa8859dfab543094d802337e8843166639ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=8Carodej?= Date: Wed, 18 May 2022 17:39:05 +0200 Subject: [PATCH] logout bug fixed --- resources/js/store/modules/userAuth.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/resources/js/store/modules/userAuth.js b/resources/js/store/modules/userAuth.js index 176bf11d..e293dda3 100644 --- a/resources/js/store/modules/userAuth.js +++ b/resources/js/store/modules/userAuth.js @@ -43,10 +43,15 @@ const actions = { axios .post('/logout') - .catch(() => this.$isSomethingWrong()) + .catch((error) => { + if (error.response.status === 500) { + Vue.prototype.$isSomethingWrong() + } + }) .finally(() => { clearTimeout(popup) + commit('PROCESSING_POPUP', undefined) commit('DESTROY_DATA') commit('SET_AUTHORIZED', false) @@ -65,7 +70,7 @@ const actions = { window.location.href = response.data.data.url } }) - .catch(() => this.$isSomethingWrong()) + .catch(() => Vue.prototype.$isSomethingWrong()) }, addToFavourites: (context, folder) => { let items = [folder]