doxa-maps-cdn/app/plugins/auth.client.ts
2026-04-21 12:12:54 +01:00

12 lines
272 B
TypeScript

export default defineNuxtPlugin(async () => {
const { restoreFromCache, checkAuth, setAuthReady } = useAuth()
restoreFromCache()
const hasAuthCookie = document.cookie.includes('auth-token')
if (hasAuthCookie) {
await checkAuth()
}
setAuthReady(true)
})