import { NextResponse } from "next/server"; import { AUTOTRADE_API_ERROR_CODE, createAutotradeErrorResponse, getAutotradeSession, getAutotradeUserId, } from "@/app/api/autotrade/_shared"; export async function GET(request: Request) { const userId = await getAutotradeUserId(request.headers); if (!userId) { return createAutotradeErrorResponse({ status: 401, code: AUTOTRADE_API_ERROR_CODE.AUTH_REQUIRED, message: "로그인이 필요합니다.", }); } const session = getAutotradeSession(userId); return NextResponse.json({ ok: true, session: session && session.runtimeState === "RUNNING" ? session : null, }); }