Use token from cookies directly

This commit is contained in:
2025-09-27 14:31:17 +02:00
parent aec851f0d1
commit 72171c4dfb
5 changed files with 24 additions and 20 deletions
+8 -1
View File
@@ -40,7 +40,14 @@ export async function GET(req: NextRequest) {
}
export async function POST(req: NextRequest) {
let { server_ip, session_token } = await req.json();
let { server_ip } = await req.json();
const session_token = req.cookies.get("token")?.value;
if (!session_token)
return NextResponse.json(
{ message: "Token cookie not found" },
{ status: StatusCodes.UNAUTHORIZED }
);
const token = crypto.randomUUID();