initial webapp

This commit is contained in:
2025-07-15 18:58:21 +02:00
parent 835b73552b
commit 253111f741
32 changed files with 3885 additions and 77 deletions

View File

@@ -1,5 +1,14 @@
import { redirect } from "next/navigation";
import { cookies } from 'next/headers';
import { redirect } from 'next/navigation';
export default function Home() {
redirect("/welcome");
export default async function Home() {
const cookieStore = await cookies();
const token = cookieStore.get('habit-tracker-token');
// If user has a token, redirect to dashboard, otherwise to welcome
if (token?.value) {
redirect('/dashboard');
} else {
redirect('/welcome');
}
}