Răsfoiți Sursa

fix: address interview dashboard follow-up review

alvinreal 2 luni în urmă
părinte
comite
91618e1cf5
2 a modificat fișierele cu 12 adăugiri și 0 ștergeri
  1. 8 0
      src/interview/dashboard.ts
  2. 4 0
      src/interview/document.ts

+ 8 - 0
src/interview/dashboard.ts

@@ -1000,6 +1000,10 @@ export function createDashboardServer(config: DashboardConfig): {
       pathname.startsWith('/api/interviews/') &&
       pathname.endsWith('/block-comment')
     ) {
+      if (!isAuthenticated(request)) {
+        sendJson(response, 401, { error: 'Unauthorized' });
+        return;
+      }
       const interviewId = pathname
         .replace('/api/interviews/', '')
         .replace('/block-comment', '');
@@ -1075,6 +1079,10 @@ export function createDashboardServer(config: DashboardConfig): {
       pathname.startsWith('/api/interviews/') &&
       pathname.endsWith('/chat')
     ) {
+      if (!isAuthenticated(request)) {
+        sendJson(response, 401, { error: 'Unauthorized' });
+        return;
+      }
       const interviewId = pathname
         .replace('/api/interviews/', '')
         .replace('/chat', '');

+ 4 - 0
src/interview/document.ts

@@ -293,6 +293,10 @@ export function parseSpecBlocks(markdown: string): SpecBlock[] {
   };
 
   for (const line of lines) {
+    if (/^##\s+Q&A history\s*$/i.test(line)) {
+      break;
+    }
+
     const headerMatch = line.match(/^##\s+(\d+)\.\s+(.+)$/);
     if (headerMatch) {
       flush();