Full project added
This commit is contained in:
22
app/login/page.tsx
Normal file
22
app/login/page.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { cookies } from "next/headers";
|
||||
import { redirect } from "next/navigation";
|
||||
import LoginForm from "./LoginForm"; // adjust path if needed
|
||||
|
||||
|
||||
export default async function LoginPage({
|
||||
searchParams,
|
||||
}: {
|
||||
searchParams?: { next?: string };
|
||||
}) {
|
||||
const session = (await cookies()).get("mis_session")?.value;
|
||||
|
||||
// If already logged in, send to next or machines
|
||||
if (session) {
|
||||
const next = searchParams?.next || "/machines";
|
||||
redirect(next);
|
||||
}
|
||||
|
||||
// ...your existing login UI below
|
||||
return <LoginForm />; // ✅ actually render it
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user