diff --git a/src/app/(auth)/login/login-form.tsx b/src/app/(auth)/login/login-form.tsx index 950d5dd..95c229e 100644 --- a/src/app/(auth)/login/login-form.tsx +++ b/src/app/(auth)/login/login-form.tsx @@ -3,7 +3,7 @@ import { useState } from "react"; import { useRouter } from "next/navigation"; import Link from "next/link"; -import { signIn } from "@/lib/auth-client"; +import { signIn, authClient } from "@/lib/auth-client"; export function LoginForm() { const router = useRouter(); @@ -25,7 +25,16 @@ export function LoginForm() { return; } - router.push("/dashboard"); + const session = await authClient.getSession(); + const role = session.data?.user?.role; + + if (role === "admin") { + router.push("/admin/dashboard"); + } else if (role === "curator") { + router.push("/curator/dashboard"); + } else { + router.push("/dashboard"); + } router.refresh(); }