From 10541261da7512220124667a47568a9cc3f40075 Mon Sep 17 00:00:00 2001 From: hamster1963 <1410514192@qq.com> Date: Thu, 24 Oct 2024 21:49:47 +0800 Subject: [PATCH] fix: build error --- app/[locale]/login/page.tsx | 48 ------------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 app/[locale]/login/page.tsx 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 ( -
-
-
-
-
- - -
-
-
-
- ) -}