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({ export function MagicLinkAuthContainer({
inviteToken, inviteToken,
redirectUrl, redirectUrl,
shouldCreateUser,
}: { }: {
inviteToken?: string; inviteToken?: string;
redirectUrl: string; redirectUrl: string;
shouldCreateUser: boolean;
}) { }) {
const { captchaToken, resetCaptchaToken } = useCaptchaToken(); const { captchaToken, resetCaptchaToken } = useCaptchaToken();
const { t } = useTranslation(); const { t } = useTranslation();
@@ -56,6 +58,7 @@ export function MagicLinkAuthContainer({
options: { options: {
emailRedirectTo, emailRedirectTo,
captchaToken, captchaToken,
shouldCreateUser,
}, },
}); });

View File

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

View File

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