fix(auth): removed auto logout

This commit is contained in:
gabdevele
2026-06-15 11:47:40 +02:00 Unverified
parent b120b6f989
commit 48f0f65dc1
3 changed files with 18 additions and 18 deletions
+7 -1
View File
@@ -5,9 +5,15 @@ export default defineNuxtPlugin(async () => {
try {
await auth.syncUser()
} catch (error) {
const status = (error as any)?.statusCode || (error as any)?.status || (error as any)?.response?.status
if (status === 401 || status === 403) {
console.error('[Auth Plugin] Sync failed with authentication error, keeping session state:', error)
return
}
console.error('[Auth Plugin] Sync failed:', error)
auth.logout()
}
}
})