File tree 3 files changed +18
-5
lines changed
client/packages/lowcoder/src/pages
3 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ function InviteLanding(props: InviteLandingProp) {
45
45
orgId = inviteInfo . invitedOrganizationId ;
46
46
const inviteState = inviteInfo ? { ...inviteInfo , invitationId } : { invitationId } ;
47
47
history . push ( {
48
- pathname : AUTH_LOGIN_URL ,
48
+ pathname : `/org/ ${ orgId } /auth/login` ,
49
49
state : {
50
50
inviteInfo : inviteState ,
51
51
} ,
Original file line number Diff line number Diff line change @@ -31,6 +31,13 @@ export default function FormLogin(props: FormLoginProps) {
31
31
const [ password , setPassword ] = useState ( "" ) ;
32
32
const { fetchUserAfterAuthSuccess } = useContext ( AuthContext ) ;
33
33
34
+ const afterLoginSuccess = ( ) => {
35
+ if ( props . organizationId ) {
36
+ localStorage . setItem ( "lowcoder_login_orgId" , props . organizationId ) ;
37
+ }
38
+ fetchUserAfterAuthSuccess ?.( ) ;
39
+ }
40
+
34
41
const { onSubmit, loading } = useAuthSubmit (
35
42
( ) =>
36
43
UserApi . formLogin ( {
@@ -42,7 +49,7 @@ export default function FormLogin(props: FormLoginProps) {
42
49
} ) ,
43
50
false ,
44
51
null ,
45
- fetchUserAfterAuthSuccess ,
52
+ afterLoginSuccess ,
46
53
) ;
47
54
48
55
return (
Original file line number Diff line number Diff line change @@ -230,10 +230,16 @@ export default function FormLoginSteps(props: FormLoginProps) {
230
230
}
231
231
} , [ isEnterpriseMode ] ) ;
232
232
233
- if ( isEnterpriseMode ) {
233
+ useEffect ( ( ) => {
234
+ if ( Boolean ( props . organizationId ) ) {
235
+ fetchOrgsByEmail ( ) ;
236
+ }
237
+ } , [ props . organizationId ] ) ;
238
+
239
+ if ( isEnterpriseMode || Boolean ( props . organizationId ) ) {
234
240
return (
235
241
< Spin indicator = { < LoadingOutlined style = { { fontSize : 30 } } /> } spinning = { isFetchingConfig } >
236
- { isEmailLoginEnabled && < FormLogin /> }
242
+ { isEmailLoginEnabled && < FormLogin organizationId = { props . organizationId } /> }
237
243
< ThirdPartyAuth
238
244
invitationId = { invitationId }
239
245
invitedOrganizationId = { organizationId }
@@ -244,7 +250,7 @@ export default function FormLoginSteps(props: FormLoginProps) {
244
250
< Divider />
245
251
< AuthBottomView >
246
252
< StyledRouteLink to = { {
247
- pathname : AUTH_REGISTER_URL ,
253
+ pathname : props . organizationId ? `/org/ ${ props . organizationId } /auth/register` : AUTH_REGISTER_URL ,
248
254
state : { ...location . state || { } , email : account }
249
255
} } >
250
256
{ trans ( "userAuth.register" ) }
You can’t perform that action at this time.
0 commit comments