11import { useClerk } from '@clerk/shared/react' ;
22import React from 'react' ;
33
4- import { ERROR_CODES } from '../../../core/constants' ;
4+ import { ERROR_CODES , SIGN_UP_MODES } from '../../../core/constants' ;
55import { getClerkQueryParam , removeClerkQueryParam } from '../../../utils/getClerkQueryParam' ;
66import { buildSSOCallbackURL , withRedirectToAfterSignUp } from '../../common' ;
77import { useCoreSignUp , useEnvironment , useSignUpContext } from '../../contexts' ;
@@ -22,6 +22,7 @@ import { buildRequest, createPasswordError, handleError, useFormControl } from '
2222import { SignUpForm } from './SignUpForm' ;
2323import type { ActiveIdentifier } from './signUpFormHelpers' ;
2424import { determineActiveFields , emailOrPhone , getInitialActiveIdentifier , showFormFields } from './signUpFormHelpers' ;
25+ import { SignUpRestrictedAccess } from './SignUpRestrictedAccess' ;
2526import { SignUpSocialButtons } from './SignUpSocialButtons' ;
2627import { completeSignUpFlow } from './util' ;
2728
@@ -49,6 +50,8 @@ function _SignUpStart(): JSX.Element {
4950 userSettings : { passwordSettings } ,
5051 } = useEnvironment ( ) ;
5152
53+ const { mode } = userSettings . signUp ;
54+
5255 const formState = {
5356 firstName : useFormControl ( 'firstName' , signUp . firstName || initialValues . firstName || '' , {
5457 type : 'text' ,
@@ -246,6 +249,10 @@ function _SignUpStart(): JSX.Element {
246249 ( ! hasTicket || missingRequirementsWithTicket ) && userSettings . authenticatableSocialStrategies . length > 0 ;
247250 const showWeb3Providers = ! hasTicket && userSettings . web3FirstFactors . length > 0 ;
248251
252+ if ( mode === SIGN_UP_MODES . RESTRICTED && ! hasTicket ) {
253+ return < SignUpRestrictedAccess /> ;
254+ }
255+
249256 return (
250257 < Flow . Part part = 'start' >
251258 < Card . Root >
0 commit comments