elearning/frontend_management/plugins/01.auth.ts

12 lines
319 B
TypeScript
Raw Normal View History

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();
}
});