portal(settings): embed authed SettingsSubmit form in Add tab; switcher remembers last data tab
This commit is contained in:
parent
e2d5042e60
commit
e6c37d0b14
6 changed files with 1595 additions and 823 deletions
16
app/api/me/route.ts
Normal file
16
app/api/me/route.ts
Normal 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" },
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue