render auth page client-side to avoid vercel bug on searchParams

This commit is contained in:
Matthias Nannt
2022-12-01 16:20:06 +01:00
parent 2335c72234
commit 83f3df4e81

View File

@@ -1,21 +1,25 @@
import { Logo } from "@/app/Logo";
"use client";
import { useSearchParams } from "next/navigation";
import { RequestVerificationEmail } from "./RequestVerificationEmail";
interface SignInProps {
/* interface SignInProps {
searchParams?: {
email?: string;
};
}
};
} */
export default function SignIn({ searchParams }: SignInProps) {
export default function SignIn() {
const searchParams = useSearchParams();
return (
<>
{searchParams.email ? (
{searchParams.get("email") ? (
<>
<h1 className="leading-2 mb-4 text-center font-bold">Please verify your email address</h1>
<p className="text-center">
We have sent you an email to the address <span className="italic">{searchParams.email}</span>.
Please click the link in the email to activate your account.
We have sent you an email to the address{" "}
<span className="italic">{searchParams.get("email")}</span>. Please click the link in the email to
activate your account.
</p>
<hr className="my-4" />
<p className="text-center text-xs">
@@ -24,7 +28,7 @@ export default function SignIn({ searchParams }: SignInProps) {
Click the button below to request a new email.
</p>
<div className="mt-5">
<RequestVerificationEmail email={searchParams.email} />
<RequestVerificationEmail email={searchParams.get("email")} />
</div>
</>
) : (