Skip to content

Commit

Permalink
Update App.vue
Browse files Browse the repository at this point in the history
Related to remixz#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.
  • Loading branch information
yowkah authored Dec 11, 2021
1 parent 1880844 commit 5f3179f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)}`)
Expand Down

0 comments on commit 5f3179f

Please sign in to comment.