diff --git a/packages/stack/src/components-page/auth-page.tsx b/packages/stack/src/components-page/auth-page.tsx
index 39e8704e8..367c7e4d2 100644
--- a/packages/stack/src/components-page/auth-page.tsx
+++ b/packages/stack/src/components-page/auth-page.tsx
@@ -14,6 +14,7 @@ import { OAuthButtonGroup } from '../components/oauth-button-group';
import { useTranslation } from '../lib/translations';
export function AuthPage(props: {
+ noPasswordRepeat?: boolean,
fullPage?: boolean,
type: 'sign-in' | 'sign-up',
automaticRedirect?: boolean,
@@ -92,11 +93,11 @@ export function AuthPage(props: {
- {props.type === 'sign-up' ? : }
+ {props.type === 'sign-up' ? : }
) : project.config.credentialEnabled ? (
- props.type === 'sign-up' ? :
+ props.type === 'sign-up' ? :
) : project.config.magicLinkEnabled ? (
) : null}
diff --git a/packages/stack/src/components-page/sign-up.tsx b/packages/stack/src/components-page/sign-up.tsx
index 48c80fdd7..2fd0b83f3 100644
--- a/packages/stack/src/components-page/sign-up.tsx
+++ b/packages/stack/src/components-page/sign-up.tsx
@@ -1,6 +1,17 @@
'use client';
import { AuthPage } from './auth-page';
-export function SignUp(props: { fullPage?: boolean, automaticRedirect?: boolean, extraInfo?: React.ReactNode }) {
- return ;
+export function SignUp(props: {
+ fullPage?: boolean,
+ automaticRedirect?: boolean,
+ noPasswordRepeat?: boolean,
+ extraInfo?: React.ReactNode,
+}) {
+ return ;
}
diff --git a/packages/stack/src/components/credential-sign-up.tsx b/packages/stack/src/components/credential-sign-up.tsx
index 7d0db193f..542b2a367 100644
--- a/packages/stack/src/components/credential-sign-up.tsx
+++ b/packages/stack/src/components/credential-sign-up.tsx
@@ -12,7 +12,7 @@ import { useStackApp } from "..";
import { useTranslation } from "../lib/translations";
import { FormWarningText } from "./elements/form-warning";
-export function CredentialSignUp() {
+export function CredentialSignUp(props: { noPasswordRepeat?: boolean }) {
const { t } = useTranslation();
const schema = yupObject({
@@ -28,7 +28,9 @@ export function CredentialSignUp() {
}
}
}),
- passwordRepeat: yupString().nullable().oneOf([yup.ref('password'), "", null], t('Passwords do not match')).required(t('Please repeat your password'))
+ ...(!props.noPasswordRepeat && {
+ passwordRepeat: yupString().nullable().oneOf([yup.ref('password'), "", null], t('Passwords do not match')).required(t('Please repeat your password'))
+ })
});
const { register, handleSubmit, setError, formState: { errors }, clearErrors } = useForm({
@@ -74,18 +76,23 @@ export function CredentialSignUp() {
}}
/>
-
-
- {
- clearErrors('password');
- clearErrors('passwordRepeat');
- runAsynchronously(registerPasswordRepeat.onChange(e));
- }}
- />
-
+ {
+ !props.noPasswordRepeat && (
+ <>
+
+ {
+ clearErrors('password');
+ clearErrors('passwordRepeat');
+ runAsynchronously(registerPasswordRepeat.onChange(e));
+ }}
+ />
+
+ >
+ )
+ }