From 5f3179f46ca78095c9b2ad7165ed0f03110fa09d Mon Sep 17 00:00:00 2001 From: yowkah Date: Sat, 11 Dec 2021 06:15:19 +0100 Subject: [PATCH] Update App.vue Related to #50 . It seems that the Token is not always given with authentication. Absence of the token should not be valid reason to terminate or remove a perfectly good session. --- src/App.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.vue b/src/App.vue index ab73c97..36ef236 100644 --- a/src/App.vue +++ b/src/App.vue @@ -133,7 +133,7 @@ export default { this.$route.name !== 'login' && this.$route.name !== 'future-of-umi' && Object.keys(this.$store.state.auth).length > 0 && - (!this.$store.state.auth.token || !this.$store.state.auth.expires || new Date() > new Date(this.$store.state.auth.expires)) + (!this.$store.state.auth.expires || new Date() > new Date(this.$store.state.auth.expires)) ) { await this.$store.dispatch('logout', true) this.$router.replace(`/login?next=${encodeURIComponent(this.$route.fullPath)}`)