const LOGO_SVG = ``; function escapeHtml(value: string): string { return value .replaceAll("&", "&") .replaceAll("<", "<") .replaceAll(">", ">") .replaceAll('"', """) .replaceAll("'", "'"); } function renderPage(options: { title: string; heading: string; message: string; details?: string }): string { const title = escapeHtml(options.title); const heading = escapeHtml(options.heading); const message = escapeHtml(options.message); const details = options.details ? escapeHtml(options.details) : undefined; return ` ${title}

${heading}

${message}

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