import renderToString from "preact-render-to-string" import SigninPage from "./signin" import SignoutPage from "./signout" import VerifyRequestPage from "./verify-request" import ErrorPage from "./error" import css from "../../css" import type { InternalOptions } from "../types" import type { RequestInternal, ResponseInternal } from ".." import type { Cookie } from "../lib/cookie" import type { ErrorType } from "./error" type RenderPageParams = { query?: RequestInternal["query"] cookies?: Cookie[] } & Partial< Pick< InternalOptions, "url" | "callbackUrl" | "csrfToken" | "providers" | "theme" > > /** * Unless the user defines their [own pages](https://next-auth.js.org/configuration/pages), * we render a set of default ones, using Preact SSR. */ export default function renderPage(params: RenderPageParams) { const { url, theme, query, cookies } = params function send({ html, title, status }: any): ResponseInternal { return { cookies, status, headers: [{ key: "Content-Type", value: "text/html" }], body: `