diff --git a/app/[locale]/login/page.tsx b/app/[locale]/login/page.tsx deleted file mode 100644 index ffbae6f..0000000 --- a/app/[locale]/login/page.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import Footer from "@/app/[locale]/(main)/footer" -import Header from "@/app/[locale]/(main)/header" -import { auth, signIn } from "@/auth" -import { getLocale } from "next-intl/server" -import { redirect } from "next/navigation" - -export const runtime = 'edge'; - -export default async function Login() { - - const locale = await getLocale() - - const session = await auth() - if (session) { - redirect(`/${locale}`) - } - - - async function handleSubmit(formData: FormData) { - 'use server' - try { - await signIn("credentials", formData, { redirectTo: `/${locale}` }) - } catch (error) { - redirect(`/${locale}/login`) - } - } - - return ( -
-
-
-
-
- - -
-
-
-
- ) -}