import { Theme } from "../.." import { InternalUrl } from "../../utils/parse-url" /** * The following errors are passed as error query parameters to the default or overridden error page. * * [Documentation](https://next-auth.js.org/configuration/pages#error-page) */ export type ErrorType = | "default" | "configuration" | "accessdenied" | "verification" export interface ErrorProps { url?: InternalUrl theme?: Theme error?: ErrorType } interface ErrorView { status: number heading: string message: JSX.Element signin?: JSX.Element } /** Renders an error page. */ export default function ErrorPage(props: ErrorProps) { const { url, error = "default", theme } = props const signinPageUrl = `${url}/signin` const errors: Record = { default: { status: 200, heading: "Error", message: (

{url?.host}

), }, configuration: { status: 500, heading: "Server error", message: (

There is a problem with the server configuration.

Check the server logs for more information.

), }, accessdenied: { status: 403, heading: "Access Denied", message: (

You do not have permission to sign in.

Sign in

), }, verification: { status: 403, heading: "Unable to sign in", message: (

The sign in link is no longer valid.

It may have been used already or it may have expired.

), signin: ( Sign in ), }, } const { status, heading, message, signin } = errors[error.toLowerCase()] ?? errors.default return { status, html: (
{theme?.brandColor && (