fix(auth): removed auto logout
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user