/opt/canhelp/node_modules/better-auth/dist/api/routes
NameSizeModeActions
account.d.mts119240644editdlrm
account.mjs195270644editdlrm
account.mjs.map405090644editdlrm
callback.d.mts10140644editdlrm
callback.mjs69790644editdlrm
callback.mjs.map135720644editdlrm
email-verification.d.mts40800644editdlrm
email-verification.mjs114020644editdlrm
email-verification.mjs.map233670644editdlrm
error.d.mts6030644editdlrm
error.mjs129680644editdlrm
error.mjs.map170090644editdlrm
index.d.mts10440644editdlrm
index.mjs10580644editdlrm
ok.d.mts7730644editdlrm
ok.mjs7040644editdlrm
ok.mjs.map14240644editdlrm
password.d.mts45140644editdlrm
password.mjs84580644editdlrm
password.mjs.map168640644editdlrm
session.d.mts116080644editdlrm
session.mjs186520644editdlrm
session.mjs.map404940644editdlrm
sign-in.d.mts73530644editdlrm
sign-in.mjs109480644editdlrm
sign-in.mjs.map253640644editdlrm
sign-out.d.mts7880644editdlrm
sign-out.mjs10260644editdlrm
sign-out.mjs.map20100644editdlrm
sign-up.d.mts46570644editdlrm
sign-up.mjs97190644editdlrm
sign-up.mjs.map203860644editdlrm
update-session.d.mts19910644editdlrm
update-session.mjs19840644editdlrm
update-session.mjs.map40180644editdlrm
update-user.d.mts115680644editdlrm
update-user.mjs191580644editdlrm
update-user.mjs.map390530644editdlrm
Edit: /opt/canhelp/node_modules/better-auth/dist/api/routes/error.mjs (12968B)
import { HIDE_METADATA } from "../../utils/hide-metadata.mjs"; import { isProduction } from "@better-auth/core/env"; import { createAuthEndpoint } from "@better-auth/core/api"; //#region src/api/routes/error.ts function sanitize(input) { return input.replace(//g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/&(?!amp;|lt;|gt;|quot;|#39;|#x[0-9a-fA-F]+;|#[0-9]+;)/g, "&"); } const html = (options, code = "Unknown", description = null) => { const custom = options.onAPIError?.customizeDefaultErrorPage; return ` Error
${custom?.disableBackgroundGrid ? "" : `
`}
${custom?.disableCornerDecorations ? "" : `
`}

ERROR

Something went wrong

CODE: ${sanitize(code)}

${!description ? `We encountered an unexpected error. Please try again or return to the home page. If you're a developer, you can find more information about the error here.` : description}

Go Home
Ask AI
`; }; const error = createAuthEndpoint("/error", { method: "GET", metadata: { ...HIDE_METADATA, openapi: { description: "Displays an error page", responses: { "200": { description: "Success", content: { "text/html": { schema: { type: "string", description: "The HTML content of the error page" } } } } } } } }, async (c) => { const url = new URL(c.request?.url || ""); const unsanitizedCode = url.searchParams.get("error") || "UNKNOWN"; const unsanitizedDescription = url.searchParams.get("error_description") || null; const safeCode = /^[\'A-Za-z0-9_-]+$/.test(unsanitizedCode || "") ? unsanitizedCode : "UNKNOWN"; const safeDescription = unsanitizedDescription ? sanitize(unsanitizedDescription) : null; const queryParams = new URLSearchParams(); queryParams.set("error", safeCode); if (unsanitizedDescription) queryParams.set("error_description", unsanitizedDescription); const options = c.context.options; const errorURL = options.onAPIError?.errorURL; if (errorURL) return new Response(null, { status: 302, headers: { Location: `${errorURL}${errorURL.includes("?") ? "&" : "?"}${queryParams.toString()}` } }); if (isProduction && !options.onAPIError?.customizeDefaultErrorPage) return new Response(null, { status: 302, headers: { Location: `/?${queryParams.toString()}` } }); return new Response(html(c.context.options, safeCode, safeDescription), { headers: { "Content-Type": "text/html" } }); }); //#endregion export { error }; //# sourceMappingURL=error.mjs.map