${escapeHtml(title)}
${description}
${destination ? `Return to T3 Code` : ""}import { providerAuthReturnUrl } from "@t3tools/shared/providerAuthReturnUrl"; export const codexAuthReturnUrl = providerAuthReturnUrl; const escapeHtml = (value: string) => value.replace( /[&<>"']/gu, (character) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[character]!, ); export function codexAuthCallbackPage( success: boolean, returnUrl: string | undefined, nonce: string, ) { const destination = codexAuthReturnUrl(returnUrl); const title = success ? "You're signed in" : "Sign-in couldn't finish"; const description = success ? destination ? "Returning to T3 Code. You're ready to continue." : "Return to T3 Code to continue. You can close this tab." : "Return to T3 Code and try signing in again."; return `
${description}
${destination ? `Return to T3 Code` : ""}