File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export default function AuthPage() {
1212 const searchParams = useSearchParams ( ) ;
1313
1414 const mode = searchParams . get ( 'mode' ) || 'signin' ;
15+ const invitation = searchParams . get ( 'invitation' ) ;
1516 const [ currentMode , setCurrentMode ] = useState < 'signin' | 'signup' > (
1617 mode as 'signin' | 'signup'
1718 ) ;
@@ -40,7 +41,10 @@ export default function AuthPage() {
4041 { currentMode === 'signin' ? (
4142 < LoginWrapper setLoadingState = { setLoadingState } />
4243 ) : (
43- < SignupWrapper setLoadingState = { setLoadingState } />
44+ < SignupWrapper
45+ setLoadingState = { setLoadingState }
46+ invitation = { invitation }
47+ />
4448 ) }
4549 </ div >
4650 </ div >
Original file line number Diff line number Diff line change @@ -38,9 +38,10 @@ const formSchema = z.object({
3838
3939interface SignupFormProps {
4040 onLoadingChange ?: ( isLoading : boolean ) => void ;
41+ invitation ?: string | null ;
4142}
4243
43- const SignupForm = ( { onLoadingChange } : SignupFormProps ) => {
44+ const SignupForm = ( { onLoadingChange, invitation } : SignupFormProps ) => {
4445 const router = useRouter ( ) ;
4546 const [ step , setStep ] = useState < 'signup' | 'otp' > ( 'signup' ) ;
4647 const [ userData , setUserData ] = useState < { email : string } | null > ( null ) ;
@@ -80,6 +81,7 @@ const SignupForm = ({ onLoadingChange }: SignupFormProps) => {
8081 lastName : values . lastName ,
8182 password : values . password ,
8283 username : values . email . split ( '@' ) [ 0 ] ,
84+ invitation : invitation || undefined ,
8385 } ) ;
8486
8587 if ( response . message ) {
Original file line number Diff line number Diff line change @@ -5,13 +5,15 @@ import SignupForm from './SignupForm';
55
66const SignupWrapper = ( {
77 setLoadingState,
8+ invitation,
89} : {
910 setLoadingState : ( isLoading : boolean ) => void ;
11+ invitation ?: string | null ;
1012} ) => {
1113 const [ isLoading , setIsLoading ] = useState ( false ) ;
1214 setLoadingState ( isLoading ) ;
1315
14- return < SignupForm onLoadingChange = { setIsLoading } /> ;
16+ return < SignupForm onLoadingChange = { setIsLoading } invitation = { invitation } /> ;
1517} ;
1618
1719export default SignupWrapper ;
Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ export interface RegisterRequest {
6666 firstName : string ;
6767 lastName : string ;
6868 username : string ;
69+ invitation ?: string ;
6970}
7071export interface RegisterResponse {
7172 message : string ;
You can’t perform that action at this time.
0 commit comments