Files
app/app/page.tsx
Albert a73b454a72 feat: Add authentication redirects for / and /chat routes
Implemented server-side authentication redirects:
- Root (/) redirects to /chat if authenticated, /login if not
- /chat route requires authentication via layout component
- Removed deprecated middleware file in favor of Next.js server components

This ensures users are properly directed based on their authentication state.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 04:55:52 +00:00

17 lines
379 B
TypeScript

import { redirect } from 'next/navigation';
import { cookies } from 'next/headers';
/**
* Root page - redirects to /chat if authenticated, /login if not
*/
export default async function Home() {
const cookieStore = await cookies();
const authCookie = cookieStore.get('ponderants-auth');
if (authCookie) {
redirect('/chat');
} else {
redirect('/login');
}
}