@@ -101,6 +101,7 @@ export default function FormLoginSteps(props: FormLoginProps) {
101101 const { systemConfig, inviteInfo, fetchUserAfterAuthSuccess } = useContext ( AuthContext ) ;
102102 const invitationId = inviteInfo ?. invitationId ;
103103 const authId = systemConfig ?. form . id ;
104+ const isFormLoginEnabled = systemConfig ?. form . enableLogin ;
104105 const [ orgLoading , setOrgLoading ] = useState ( false ) ;
105106 const [ orgList , setOrgList ] = useState < OrgItem [ ] > ( [ ] ) ;
106107 const [ currentStep , setCurrentStep ] = useState < CurrentStepEnum > ( CurrentStepEnum . EMAIL ) ;
@@ -227,27 +228,35 @@ export default function FormLoginSteps(props: FormLoginProps) {
227228 if ( skipWorkspaceStep ) return setCurrentStep ( CurrentStepEnum . EMAIL ) ;
228229 setCurrentStep ( CurrentStepEnum . WORKSPACES )
229230 } } />
230- < StepHeader title = { trans ( "userAuth.enterPassword" ) } />
231- < PasswordInput
232- className = "form-input password-input"
233- passInputConf = { {
234- label : ' ' ,
235- } }
236- onChange = { ( value ) => setPassword ( value ) }
237- valueCheck = { ( ) => [ true , "" ] }
231+ < StepHeader
232+ title = {
233+ isFormLoginEnabled ? trans ( "userAuth.enterPassword" ) : trans ( "userAuth.selectAuthProvider" )
234+ }
238235 />
239- < Flex justify = "end" style = { { margin : '10px 0' } } >
240- < Link to = { {
241- pathname : AUTH_FORGOT_PASSWORD_URL ,
242- state : location . state
243- } }
244- >
245- { `${ trans ( "userAuth.forgotPassword" ) } ?` }
246- </ Link >
247- </ Flex >
248- < ConfirmButton loading = { loading } disabled = { ! account || ! password } onClick = { onSubmit } >
249- { trans ( "userAuth.login" ) }
250- </ ConfirmButton >
236+ { isFormLoginEnabled && (
237+ < >
238+ < PasswordInput
239+ className = "form-input password-input"
240+ passInputConf = { {
241+ label : ' ' ,
242+ } }
243+ onChange = { ( value ) => setPassword ( value ) }
244+ valueCheck = { ( ) => [ true , "" ] }
245+ />
246+ < Flex justify = "end" style = { { margin : '10px 0' } } >
247+ < Link to = { {
248+ pathname : AUTH_FORGOT_PASSWORD_URL ,
249+ state : location . state
250+ } }
251+ >
252+ { `${ trans ( "userAuth.forgotPassword" ) } ?` }
253+ </ Link >
254+ </ Flex >
255+ < ConfirmButton loading = { loading } disabled = { ! account || ! password } onClick = { onSubmit } >
256+ { trans ( "userAuth.login" ) }
257+ </ ConfirmButton >
258+ </ >
259+ ) }
251260 { organizationId && (
252261 < ThirdPartyAuth
253262 invitationId = { invitationId }
@@ -256,15 +265,19 @@ export default function FormLoginSteps(props: FormLoginProps) {
256265 />
257266 ) }
258267 </ AccountLoginWrapper >
259- < Divider />
260- < AuthBottomView >
261- < StyledRouteLink to = { {
262- pathname : AUTH_REGISTER_URL ,
263- state : location . state
264- } } >
265- { trans ( "userAuth.register" ) }
266- </ StyledRouteLink >
267- </ AuthBottomView >
268+ { isFormLoginEnabled && (
269+ < >
270+ < Divider />
271+ < AuthBottomView >
272+ < StyledRouteLink to = { {
273+ pathname : AUTH_REGISTER_URL ,
274+ state : location . state
275+ } } >
276+ { trans ( "userAuth.register" ) }
277+ </ StyledRouteLink >
278+ </ AuthBottomView >
279+ </ >
280+ ) }
268281 </ >
269282 ) ;
270283}
0 commit comments