fix(auth): removed auto logout
This commit is contained in:
@@ -27,24 +27,9 @@ export const useApiFetch = <T>(request: string, options: Parameters<typeof $fetc
|
||||
const status = err?.statusCode || err?.status || err?.response?.status
|
||||
|
||||
if (status === 401 || status === 403) {
|
||||
try {
|
||||
tokenCookie.value = null
|
||||
tokenState.value = null
|
||||
const authUser = useState('auth_user')
|
||||
authUser.value = null
|
||||
|
||||
console.error(`[API] Authentication error (${status}) - token cleared`)
|
||||
} catch (e) {
|
||||
console.error('[API] Error clearing auth state:', e)
|
||||
}
|
||||
|
||||
try {
|
||||
nuxtApp.runWithContext(() => navigateTo('/auth/login'))
|
||||
} catch (e) {
|
||||
console.error('[API] Error navigating to login:', e)
|
||||
}
|
||||
console.error(`[API] Authentication error (${status})`)
|
||||
}
|
||||
|
||||
throw err
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user