1
1
import { useClerk } from '@clerk/shared/react' ;
2
2
import React from 'react' ;
3
3
4
- import { ERROR_CODES } from '../../../core/constants' ;
4
+ import { ERROR_CODES , SIGN_UP_MODES } from '../../../core/constants' ;
5
5
import { getClerkQueryParam , removeClerkQueryParam } from '../../../utils/getClerkQueryParam' ;
6
6
import { buildSSOCallbackURL , withRedirectToAfterSignUp } from '../../common' ;
7
7
import { useCoreSignUp , useEnvironment , useSignUpContext } from '../../contexts' ;
@@ -22,6 +22,7 @@ import { buildRequest, createPasswordError, handleError, useFormControl } from '
22
22
import { SignUpForm } from './SignUpForm' ;
23
23
import type { ActiveIdentifier } from './signUpFormHelpers' ;
24
24
import { determineActiveFields , emailOrPhone , getInitialActiveIdentifier , showFormFields } from './signUpFormHelpers' ;
25
+ import { SignUpRestrictedAccess } from './SignUpRestrictedAccess' ;
25
26
import { SignUpSocialButtons } from './SignUpSocialButtons' ;
26
27
import { completeSignUpFlow } from './util' ;
27
28
@@ -49,6 +50,8 @@ function _SignUpStart(): JSX.Element {
49
50
userSettings : { passwordSettings } ,
50
51
} = useEnvironment ( ) ;
51
52
53
+ const { mode } = userSettings . signUp ;
54
+
52
55
const formState = {
53
56
firstName : useFormControl ( 'firstName' , signUp . firstName || initialValues . firstName || '' , {
54
57
type : 'text' ,
@@ -246,6 +249,10 @@ function _SignUpStart(): JSX.Element {
246
249
( ! hasTicket || missingRequirementsWithTicket ) && userSettings . authenticatableSocialStrategies . length > 0 ;
247
250
const showWeb3Providers = ! hasTicket && userSettings . web3FirstFactors . length > 0 ;
248
251
252
+ if ( mode === SIGN_UP_MODES . RESTRICTED && ! hasTicket ) {
253
+ return < SignUpRestrictedAccess /> ;
254
+ }
255
+
249
256
return (
250
257
< Flow . Part part = 'start' >
251
258
< Card . Root >
0 commit comments