/** Minimal HTML shown in the user's browser after the OAuth redirect. */ function escapeHtml(value: string): string { return value .replaceAll("&", "&") .replaceAll("<", "<") .replaceAll(">", ">") .replaceAll('"', """) .replaceAll("'", "'"); } function renderPage(heading: string, message: string, details?: string): string { return ` ${escapeHtml(heading)}

${escapeHtml(heading)}

${escapeHtml(message)}

${details ? `
${escapeHtml(details)}
` : ""}
`; } export function oauthSuccessHtml(message: string): string { return renderPage("Authentication successful", message); } export function oauthErrorHtml(message: string, details?: string): string { return renderPage("Authentication failed", message, details); }