This commit is contained in:
parent
af377672d9
commit
f5d8f1981f
|
|
@ -10,7 +10,6 @@ import { Metadata } from "next"
|
|||
import { cookies, headers } from "next/headers"
|
||||
import { redirect } from "next/navigation"
|
||||
import { getRuntimeEnv } from "@/lib/ipconfig" // 新增引入
|
||||
import { initSupabase } from "@/lib/supabase/init"
|
||||
|
||||
|
||||
import initTranslations from "@/lib/i18n";
|
||||
|
|
@ -31,18 +30,17 @@ export default async function Login({
|
|||
const localeString = locale;
|
||||
const { t, resources } = await initTranslations(localeString, ['translation']);
|
||||
|
||||
// const supabase = createServerClient<Database>(
|
||||
// getRuntimeEnv("SUPABASE_URL") ?? "http://localhost:8000",
|
||||
// process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
|
||||
// {
|
||||
// cookies: {
|
||||
// get(name: string) {
|
||||
// return cookieStore.get(name)?.value
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// )
|
||||
const supabase = await initSupabase()
|
||||
const supabase = createServerClient<Database>(
|
||||
getRuntimeEnv("SUPABASE_URL") ?? "http://localhost:8000",
|
||||
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
|
||||
{
|
||||
cookies: {
|
||||
get(name: string) {
|
||||
return cookieStore.get(name)?.value
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
const session = (await supabase.auth.getSession()).data.session
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue