Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

801 B
Raw Blame
import { ErrorPageWithSentry } from "@/src/components/error-page";
import { isExpectedAuthErrorPageMessage } from "@/src/features/auth/lib/expectedAuthErrors";
import { useRouter } from "next/router";

export default function AuthErrorPage() {
  const router = useRouter();
  const { error } = router.query;
  const errorMessage = error
    ? String(error)
    : "An authentication error occurred. Please reach out to support.";

  return (
    <ErrorPageWithSentry
      title="Authentication Error"
      message={errorMessage}
      // Expired magic links and deliberate SSO-domain rejections are expected
      // outcomes (see expectedAuthErrors.ts); unknown values still capture.
      expected={
        error !== undefined && isExpectedAuthErrorPageMessage(errorMessage)
      }
    />
  );
}