move isLogin to removeToken

This commit is contained in:
jb-alvarado 2024-02-21 17:44:19 +01:00
parent 48d46f6098
commit 737d86f901
3 changed files with 1 additions and 2 deletions

View File

@ -78,7 +78,6 @@ const router = useRouter()
function logout() { function logout() {
authStore.removeToken() authStore.removeToken()
authStore.isLogin = false
router.push({ path: '/' }) router.push({ path: '/' })
} }

View File

@ -107,7 +107,6 @@ async function login() {
async function logout() { async function logout() {
try { try {
authStore.removeToken() authStore.removeToken()
authStore.isLogin = false
} catch (e) { } catch (e) {
formError.value = e as string formError.value = e as string
} }

View File

@ -26,6 +26,7 @@ export const useAuth = defineStore('auth', {
removeToken() { removeToken() {
const cookie = useCookie('token') const cookie = useCookie('token')
cookie.value = null cookie.value = null
this.isLogin = false
this.jwtToken = '' this.jwtToken = ''
this.authHeader = {} this.authHeader = {}
}, },