I am new to feathers and vue js I don't understand this, when i log in a user the v-if directives works on the navbar, but when i refresh the page i notice that the user is no longer logged in still the JWT is stored in the localStorage.
App-Navbar.vue
<template>
<div>
<q-header bordered class="bg-white">
<q-toolbar>
<div class="q-gutter-sm" v-if="!user">
<q-btn to="/login" />
<q-btn to="/signup" />
</div>
<div class="q-gutter-sm" v-if="user">
<q-btn @click="logout"/>
</div>
</q-toolbar>
</q-header>
</div>
</template>
<script>
import { mapActions, mapState } from "vuex";
export default {
methods: {
...mapActions("auth", { authLogout: "logout" }),
logout() {
this.authLogout().then(() => this.$router.push("/login"));
}
},
computed: {
...mapState("auth", { user: "payload" })
}
};
</script>