Add shouldCreateUser property to MagicLinkAuthContainer

The update integrates a new property, shouldCreateUser, in MagicLinkAuthContainer component. This property defines the behavior for both the sign-in and sign-up methods. It is assigned false for sign-in and true for sign-up methods.
This commit is contained in:
giancarlo
2024-06-07 01:39:27 +07:00
parent 2e7e289495
commit a965ca9d39
3 changed files with 5 additions and 0 deletions

View File

@@ -27,9 +27,11 @@ import { useCaptchaToken } from '../captcha/client';
export function MagicLinkAuthContainer({
inviteToken,
redirectUrl,
shouldCreateUser,
}: {
inviteToken?: string;
redirectUrl: string;
shouldCreateUser: boolean;
}) {
const { captchaToken, resetCaptchaToken } = useCaptchaToken();
const { t } = useTranslation();
@@ -56,6 +58,7 @@ export function MagicLinkAuthContainer({
options: {
emailRedirectTo,
captchaToken,
shouldCreateUser,
},
});

View File

@@ -58,6 +58,7 @@ export function SignInMethodsContainer(props: {
<MagicLinkAuthContainer
inviteToken={props.inviteToken}
redirectUrl={redirectUrl}
shouldCreateUser={false}
/>
</If>

View File

@@ -42,6 +42,7 @@ export function SignUpMethodsContainer(props: {
<MagicLinkAuthContainer
inviteToken={props.inviteToken}
redirectUrl={redirectUrl}
shouldCreateUser={true}
/>
</If>