@@ -91,17 +91,13 @@ const OrganizationSetupPage = () => {
9191 const [ confirmPassword , setConfirmPassword ] = useState ( '' )
9292 const [ username , setUsername ] = useState ( '' )
9393 const [ orgName , setOrgName ] = useState ( '' )
94- const [ existingUsername , setExistingUsername ] = useState ( '' )
95- const [ existingPassword , setExistingPassword ] = useState ( '' )
9694
9795 const [ loading , setLoading ] = useState ( false )
9896 const [ authError , setAuthError ] = useState ( '' )
9997 const [ successMsg , setSuccessMsg ] = useState ( undefined )
100- const [ requiresAuthentication , setRequiresAuthentication ] = useState ( false )
10198
10299 const loginApi = useApi ( authApi . login )
103100 const registerAccountApi = useApi ( accountApi . registerAccount )
104- const getBasicAuthApi = useApi ( accountApi . getBasicAuth )
105101 const navigate = useNavigate ( )
106102
107103 const getDefaultProvidersApi = useApi ( loginMethodApi . getLoginMethods )
@@ -120,26 +116,6 @@ const OrganizationSetupPage = () => {
120116 setLoading ( true )
121117 setAuthError ( '' )
122118
123- // Check authentication first if required
124- if ( requiresAuthentication ) {
125- try {
126- const authResult = await accountApi . checkBasicAuth ( {
127- username : existingUsername ,
128- password : existingPassword
129- } )
130-
131- if ( ! authResult || ! authResult . data || authResult . data . message !== 'Authentication successful' ) {
132- setAuthError ( 'Authentication failed. Please check your existing credentials.' )
133- setLoading ( false )
134- return
135- }
136- } catch ( error ) {
137- setAuthError ( 'Authentication failed. Please check your existing credentials.' )
138- setLoading ( false )
139- return
140- }
141- }
142-
143119 // Proceed with registration after successful authentication
144120 const body = {
145121 user : {
@@ -180,17 +156,9 @@ const OrganizationSetupPage = () => {
180156 // eslint-disable-next-line react-hooks/exhaustive-deps
181157 } , [ registerAccountApi . error ] )
182158
183- useEffect ( ( ) => {
184- if ( getBasicAuthApi . data && getBasicAuthApi . data . isUsernamePasswordSet === true ) {
185- setRequiresAuthentication ( true )
186- }
187- } , [ getBasicAuthApi . data ] )
188-
189159 useEffect ( ( ) => {
190160 if ( ! isOpenSource ) {
191161 getDefaultProvidersApi . request ( )
192- } else {
193- getBasicAuthApi . request ( )
194162 }
195163 // eslint-disable-next-line react-hooks/exhaustive-deps
196164 } , [ ] )
@@ -271,60 +239,13 @@ const OrganizationSetupPage = () => {
271239 < Stack sx = { { gap : 1 } } >
272240 < Typography variant = 'h1' > Setup Account</ Typography >
273241 </ Stack >
274- { requiresAuthentication && (
275- < Alert severity = 'info' >
276- Application authentication now requires email and password. Contact administrator to setup an account.
277- </ Alert >
278- ) }
279242 { ( isOpenSource || isEnterpriseLicensed ) && (
280243 < Typography variant = 'caption' >
281244 Account setup does not make any external connections, your data stays securely on your locally hosted server.
282245 </ Typography >
283246 ) }
284247 < form onSubmit = { register } >
285248 < Stack sx = { { width : '100%' , flexDirection : 'column' , alignItems : 'left' , justifyContent : 'center' , gap : 2 } } >
286- { requiresAuthentication && (
287- < >
288- < Box >
289- < div style = { { display : 'flex' , flexDirection : 'row' } } >
290- < Typography sx = { { mb : 1 } } >
291- Existing Username< span style = { { color : 'red' } } > *</ span >
292- </ Typography >
293- < div style = { { flexGrow : 1 } } > </ div >
294- </ div >
295- < TextField
296- fullWidth
297- placeholder = 'Existing Username'
298- value = { existingUsername }
299- onChange = { ( e ) => setExistingUsername ( e . target . value ) }
300- />
301- < Typography variant = 'caption' >
302- < i > Existing username that was set as FLOWISE_USERNAME environment variable</ i >
303- </ Typography >
304- </ Box >
305- < Box >
306- < div style = { { display : 'flex' , flexDirection : 'row' } } >
307- < Typography sx = { { mb : 1 } } >
308- Existing Password< span style = { { color : 'red' } } > *</ span >
309- </ Typography >
310- < div style = { { flexGrow : 1 } } > </ div >
311- </ div >
312- < TextField
313- fullWidth
314- type = 'password'
315- placeholder = 'Existing Password'
316- value = { existingPassword }
317- onChange = { ( e ) => setExistingPassword ( e . target . value ) }
318- />
319- < Typography variant = 'caption' >
320- < i > Existing password that was set as FLOWISE_PASSWORD environment variable</ i >
321- </ Typography >
322- </ Box >
323- < Divider >
324- < Chip label = 'New Account Details' size = 'small' />
325- </ Divider >
326- </ >
327- ) }
328249 { isEnterpriseLicensed && (
329250 < >
330251 < Box >
@@ -416,12 +337,7 @@ const OrganizationSetupPage = () => {
416337 < i > Reconfirm your password. Must match the password typed above.</ i >
417338 </ Typography >
418339 </ Box >
419- < StyledButton
420- variant = 'contained'
421- style = { { borderRadius : 12 , height : 40 , marginRight : 5 } }
422- type = 'submit'
423- disabled = { requiresAuthentication && ( ! existingUsername || ! existingPassword ) }
424- >
340+ < StyledButton variant = 'contained' style = { { borderRadius : 12 , height : 40 , marginRight : 5 } } type = 'submit' >
425341 Sign Up
426342 </ StyledButton >
427343 { configuredSsoProviders && configuredSsoProviders . length > 0 && < Divider sx = { { width : '100%' } } > OR</ Divider > }
0 commit comments