11 lines
319 B
TypeScript
11 lines
319 B
TypeScript
export default defineNuxtPlugin({
|
|
name: 'auth-restore',
|
|
parallel: false,
|
|
async setup() {
|
|
const authStore = useAuthStore();
|
|
|
|
// Restore auth state from cookies on app initialization
|
|
// Now async - will attempt to refresh token if needed
|
|
await authStore.checkAuth();
|
|
}
|
|
});
|