Auth fix + Registration Clarity (#3590)

* clarify auth flow

* k

* nit

* k

* fix typing
This commit is contained in:
pablonyx
2025-01-05 18:17:45 -08:00
committed by GitHub
parent e100a5e965
commit c8090ab75b
6 changed files with 31 additions and 10 deletions

View File

@@ -19,11 +19,13 @@ export function EmailPasswordForm({
shouldVerify,
referralSource,
nextUrl,
defaultEmail,
}: {
isSignup?: boolean;
shouldVerify?: boolean;
referralSource?: string;
nextUrl?: string | null;
defaultEmail?: string | null;
}) {
const { user } = useUser();
const { popup, setPopup } = usePopup();
@@ -34,7 +36,7 @@ export function EmailPasswordForm({
{popup}
<Formik
initialValues={{
email: "",
email: defaultEmail || "",
password: "",
}}
validationSchema={Yup.object().shape({

View File

@@ -22,6 +22,10 @@ const Page = async (props: {
? searchParams?.next[0]
: searchParams?.next || null;
const defaultEmail = Array.isArray(searchParams?.email)
? searchParams?.email[0]
: searchParams?.email || null;
// catch cases where the backend is completely unreachable here
// without try / catch, will just raise an exception and the page
// will not render
@@ -93,6 +97,7 @@ const Page = async (props: {
isSignup
shouldVerify={authTypeMetadata?.requiresVerification}
nextUrl={nextUrl}
defaultEmail={defaultEmail}
/>
</div>
</>