Files

13 lines
430 B
TypeScript
Raw Permalink Normal View History

2025-05-16 15:54:17 +02:00
import { redirect } from "next/navigation";
2026-05-24 17:09:12 +02:00
import { getCurrentOrganizationSlug } from "@/features/organizations/organization-cookie";
2025-05-16 15:54:17 +02:00
import { currentUser } from "@/lib/auth/current-user";
2024-11-03 21:12:40 +01:00
2024-11-03 15:29:30 +01:00
export default async function Index() {
2025-05-16 15:54:17 +02:00
const user = await currentUser();
2024-11-03 15:29:30 +01:00
if (user) {
2025-05-16 15:54:17 +02:00
const currentOrganizationSlug = await getCurrentOrganizationSlug();
2025-07-26 14:43:59 +02:00
redirect(`/dashboard/home`);
2024-11-03 15:29:30 +01:00
}
2025-05-16 15:54:17 +02:00
redirect("/login");
2024-11-03 15:29:30 +01:00
}