diff --git a/app/signin/layout.tsx b/app/signin/layout.tsx index 7eb0d878..8d6372e3 100644 --- a/app/signin/layout.tsx +++ b/app/signin/layout.tsx @@ -1,7 +1,13 @@ +import { Metadata } from "next"; + +export const metadata: Metadata = { + title: "Enkun - Connexion", +}; + export default function SignInLayout({ children, }: { children: React.ReactNode; }) { - return <>{children}; + return children; } \ No newline at end of file diff --git a/app/signin/page.tsx b/app/signin/page.tsx index 010a2b0f..58060f5b 100644 --- a/app/signin/page.tsx +++ b/app/signin/page.tsx @@ -1,35 +1,14 @@ "use client"; -import { Metadata } from "next"; -import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; -import { redirect } from "next/navigation"; -import { SignInForm } from "@/components/auth/signin-form"; import { signIn } from "next-auth/react"; import { useRouter } from "next/navigation"; import { useState } from "react"; -import { initializeNextcloudStructure } from "@/lib/nextcloud-init"; -export const metadata: Metadata = { - title: "Enkun - Connexion", -}; - -export default async function SignIn({ - searchParams, -}: { - searchParams: { callbackUrl?: string }; -}) { - const session = await getServerSession(authOptions); +export default function SignIn() { const router = useRouter(); const [isLoading, setIsLoading] = useState(false); const [error, setError] = useState(null); - // If user is already authenticated and there's no specific callback URL, - // redirect to the home page - if (session && !searchParams.callbackUrl) { - redirect("/"); - } - const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setIsLoading(true);