@@ -101,6 +101,7 @@ export default function FormLoginSteps(props: FormLoginProps) {
101
101
const { systemConfig, inviteInfo, fetchUserAfterAuthSuccess } = useContext ( AuthContext ) ;
102
102
const invitationId = inviteInfo ?. invitationId ;
103
103
const authId = systemConfig ?. form . id ;
104
+ const isFormLoginEnabled = systemConfig ?. form . enableLogin ;
104
105
const [ orgLoading , setOrgLoading ] = useState ( false ) ;
105
106
const [ orgList , setOrgList ] = useState < OrgItem [ ] > ( [ ] ) ;
106
107
const [ currentStep , setCurrentStep ] = useState < CurrentStepEnum > ( CurrentStepEnum . EMAIL ) ;
@@ -227,27 +228,35 @@ export default function FormLoginSteps(props: FormLoginProps) {
227
228
if ( skipWorkspaceStep ) return setCurrentStep ( CurrentStepEnum . EMAIL ) ;
228
229
setCurrentStep ( CurrentStepEnum . WORKSPACES )
229
230
} } />
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
+ }
238
235
/>
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
+ ) }
251
260
{ organizationId && (
252
261
< ThirdPartyAuth
253
262
invitationId = { invitationId }
@@ -256,15 +265,19 @@ export default function FormLoginSteps(props: FormLoginProps) {
256
265
/>
257
266
) }
258
267
</ 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
+ ) }
268
281
</ >
269
282
) ;
270
283
}
0 commit comments