[TSM.ID].[11031972] PXE : Platform X Ecosystem I [118 Module -LIVE-]

This commit is contained in:
TSM.ID
2026-05-25 03:50:05 +07:00
commit e820143b3c
673 changed files with 101320 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
import { NextResponse } from "next/server";
import { cookies } from "next/headers";
export async function GET() {
const cookieStore = await cookies();
const tokenString = cookieStore.get("jumpa_token")?.value;
if (!tokenString) {
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
}
try {
const payloadBase64 = tokenString.split(".")[1];
const payloadBuffer = Buffer.from(payloadBase64, "base64");
const user = JSON.parse(payloadBuffer.toString("utf-8"));
return NextResponse.json(user);
} catch {
return NextResponse.json({ error: "Invalid Token" }, { status: 401 });
}
}