nexus-dashboard/app/layout.tsx
2026-02-01 18:42:22 +00:00

30 lines
852 B
TypeScript

import type { Metadata } from 'next';
import './globals.css';
import { cookies } from 'next/headers';
import { redirect } from 'next/navigation';
import { verifyToken } from '@/lib/auth';
export const metadata: Metadata = {
title: 'Nexus - VM Control Center',
description: 'Secure VM monitoring and management platform',
};
export default async function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const cookieStore = await cookies();
const token = cookieStore.get('auth-token')?.value;
const pathname = typeof window !== 'undefined' ? window.location.pathname : '';
// Check if we're on login page (we can't use usePathname in server component)
// So we'll handle this in the login page itself
return (
<html lang="en">
<body className="antialiased">{children}</body>
</html>
);
}