export default defineNuxtPlugin(async () => {
  const router = useRouter();
  const route = useRoute();
  
  // Skip auth check on public pages
  const publicPages = ['/login', '/signup', '/auth/callback', '/forgot-password'];
  const isPublicPage = publicPages.some(page => route.path.startsWith(page));
  
  if (!isPublicPage) {
    const { checkAuth } = useAuth();
    // Check authentication status on app startup for non-public pages
    await checkAuth();
  }
});
