username notice fix

This commit is contained in:
makearmy 2025-09-28 07:04:42 -04:00
parent db596ad71e
commit ab639edc7a
2 changed files with 10 additions and 6 deletions

View file

@ -8,7 +8,8 @@ function readCookie(name: string, cookieHeader: string) {
export async function GET(req: Request) {
const base = process.env.NEXT_PUBLIC_API_BASE_URL!;
const url = `${base}/users/me?fields=id,display_name,first_name,last_name,email`;
// ⬇️ include username
const url = `${base}/users/me?fields=id,username,display_name,first_name,last_name,email`;
// Forward the raw Cookie header (covers your session)…
const cookieHeader = req.headers.get("cookie") ?? "";
@ -22,7 +23,7 @@ export async function GET(req: Request) {
if (cookieHeader) headers.cookie = cookieHeader;
if (ma_at) headers.authorization = `Bearer ${ma_at}`;
const res = await fetch(url, { headers, cache: "no-store" });
const res = await fetch(url, { headers, cache: "no-store" });
const body = await res.json().catch(() => ({}));
return new NextResponse(JSON.stringify(body), {