Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions frontend/types/security-fix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,19 @@ export async function submitFixToBackend(
repository: string,
githubToken: string
): Promise<FixResponse> {
// Ensure authentication by checking for a valid token
if (!githubToken || githubToken.trim() === "") {
throw new Error("Missing or invalid GitHub token.");
}

const payload = createFixRequest(agentData, repository, githubToken);

const response = await fetch('/api/fix-vulnerabilities', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
// Add Authorization header for secure token handling
'Authorization': `Bearer ${githubToken}`
},
body: JSON.stringify(payload),
});
Expand Down