portal(settings): embed authed SettingsSubmit form in Add tab; switcher remembers last data tab

This commit is contained in:
makearmy 2025-09-28 01:38:08 -04:00
parent e2d5042e60
commit e6c37d0b14
6 changed files with 1595 additions and 823 deletions

16
app/api/me/route.ts Normal file
View file

@ -0,0 +1,16 @@
// app/api/me/route.ts
import { NextResponse } from "next/server";
export async function GET(req: Request) {
const cookie = req.headers.get("cookie") || "";
const base = process.env.NEXT_PUBLIC_API_BASE_URL!;
const url = `${base}/users/me?fields=id,display_name,first_name,last_name,email`;
const res = await fetch(url, { headers: { cookie }, cache: "no-store" });
const body = await res.json().catch(() => ({}));
return new NextResponse(JSON.stringify(body), {
status: res.status,
headers: { "content-type": "application/json" },
});
}