보안 점검 및 대시보드 문구 수정
This commit is contained in:
@@ -4,6 +4,7 @@ import type {
|
||||
DashboardStockSearchResponse,
|
||||
KoreanStockIndexItem,
|
||||
} from "@/features/trade/types/trade.types";
|
||||
import { hasKisApiSession } from "@/app/api/kis/_session";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
|
||||
const SEARCH_LIMIT = 10;
|
||||
@@ -26,6 +27,11 @@ const SEARCH_LIMIT = 10;
|
||||
* @see features/trade/components/dashboard-main.tsx 검색 폼에서 호출합니다.
|
||||
*/
|
||||
export async function GET(request: NextRequest) {
|
||||
const hasSession = await hasKisApiSession();
|
||||
if (!hasSession) {
|
||||
return NextResponse.json({ error: "로그인이 필요합니다." }, { status: 401 });
|
||||
}
|
||||
|
||||
// [Step 1] query string에서 검색어(q)를 읽고 공백을 제거합니다.
|
||||
const { searchParams } = new URL(request.url);
|
||||
const query = (searchParams.get("q") ?? "").trim();
|
||||
|
||||
Reference in New Issue
Block a user