Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion examples/mcp-client/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ export class MyAgent extends Agent {
status: 200
});
} else {
const safeError = JSON.stringify(result.authError || "Unknown error");
return new Response(
`<script>alert('Authentication failed: ${result.authError}'); window.close();</script>`,
`<script>alert('Authentication failed: ' + ${safeError}); window.close();</script>`,
{
headers: { "content-type": "text/html" },
status: 200
Expand Down
3 changes: 2 additions & 1 deletion site/ai-playground/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ export class Playground extends AIChatAgent<Env, PlaygroundState> {
status: 200
});
}
const safeError = JSON.stringify(result.authError || "Unknown error");
return new Response(
`<script>alert('Authentication failed: ${result.authError}'); window.close();</script>`,
`<script>alert('Authentication failed: ' + ${safeError}); window.close();</script>`,
{
headers: { "content-type": "text/html" },
status: 200
Expand Down
Loading