diff --git a/src/app/[locale]/dashboard/settings/page.tsx b/src/app/[locale]/dashboard/settings/page.tsx index a852e1a..603f9b1 100644 --- a/src/app/[locale]/dashboard/settings/page.tsx +++ b/src/app/[locale]/dashboard/settings/page.tsx @@ -4,9 +4,9 @@ import { SettingsBilling } from "@/components/dashboard/settings/SettingsBilling import { SettingsNotifications } from "@/components/dashboard/settings/SettingsNotifications"; import { SettingsProfile } from "@/components/dashboard/settings/SettingsProfile"; import { SettingsSecurity } from "@/components/dashboard/settings/SettingsSecurity"; +import { getCurrentUser } from "@/lib/auth/session"; import { createPageMetadata } from "@/lib/metadata"; import { getUserProfile } from "@/lib/profiles"; -import { createClient } from "@/lib/supabase/server"; export const metadata: Metadata = createPageMetadata({ title: "Settings", @@ -17,16 +17,12 @@ export const metadata: Metadata = createPageMetadata({ export const dynamic = "force-dynamic"; export default async function DashboardSettingsPage() { - const supabase = await createClient(); - const { - data: { user }, - } = await supabase.auth.getUser(); + // Auth is served by the V2 Identity service (JWT cookie), not Supabase. + const user = await getCurrentUser(); const email = user?.email ?? ""; const displayName = - typeof user?.user_metadata?.full_name === "string" - ? user.user_metadata.full_name - : null; + typeof user?.full_name === "string" ? user.full_name : null; const profile = user ? await getUserProfile(user.id) : null; const plan = profile?.plan ?? "free"; diff --git a/src/app/auth/callback/route.ts b/src/app/auth/callback/route.ts deleted file mode 100644 index db28502..0000000 --- a/src/app/auth/callback/route.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { NextResponse } from "next/server"; - -import { isSupabaseConfigured } from "@/lib/supabase/config"; -import { createClient } from "@/lib/supabase/server"; - -export async function GET(request: Request) { - const { searchParams, origin } = new URL(request.url); - const code = searchParams.get("code"); - const next = searchParams.get("next") ?? "/dashboard"; - - if (code && isSupabaseConfigured()) { - const supabase = await createClient(); - const { error } = await supabase.auth.exchangeCodeForSession(code); - - if (!error) { - return NextResponse.redirect(`${origin}${next}`); - } - } - - return NextResponse.redirect(`${origin}/auth?error=auth_callback_failed`); -}