mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
18 lines
582 B
TypeScript
18 lines
582 B
TypeScript
import { redirect } from "next/navigation";
|
|
import { getCurrentOrganizationSlug } from "@/features/organizations/organization-cookie";
|
|
import { currentUser } from "@/lib/auth/current-user";
|
|
import { isOnboardingDone } from "@/features/onboarding/onboarding-cookie";
|
|
|
|
export default async function Index() {
|
|
if (!(await isOnboardingDone())) {
|
|
redirect("/welcome");
|
|
}
|
|
|
|
const user = await currentUser();
|
|
if (user) {
|
|
const currentOrganizationSlug = await getCurrentOrganizationSlug();
|
|
redirect(`/dashboard/home`);
|
|
}
|
|
redirect("/login");
|
|
}
|