mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-28 21:05:17 +02:00
Auth fix + Registration Clarity (#3590)
* clarify auth flow * k * nit * k * fix typing
This commit is contained in:
@@ -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({
|
||||
|
@@ -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>
|
||||
</>
|
||||
|
Reference in New Issue
Block a user