import type { GetStaticPropsContext } from "next"; import Link from "next/link"; import { useSearchParams } from "next/navigation"; import z from "zod"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Button } from "@calcom/ui"; import { X } from "@calcom/ui/components/icon"; import PageWrapper from "@components/PageWrapper"; import AuthContainer from "@components/ui/AuthContainer"; import { ssgInit } from "@server/lib/ssg"; const querySchema = z.object({ error: z.string().optional(), }); export default function Error() { const { t } = useLocale(); const searchParams = useSearchParams(); const { error } = querySchema.parse(searchParams); const isTokenVerificationError = error?.toLowerCase() === "verification"; const errorMsg = isTokenVerificationError ? t("token_invalid_expired") : t("error_during_login"); return (

{errorMsg}

); } Error.PageWrapper = PageWrapper; export const getStaticProps = async (context: GetStaticPropsContext) => { const ssr = await ssgInit(context); return { props: { trpcState: ssr.dehydrate(), }, }; };