File tree Expand file tree Collapse file tree 3 files changed +18
-5
lines changed
client/packages/lowcoder/src/pages Expand file tree Collapse file tree 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) {
4545 orgId = inviteInfo . invitedOrganizationId ;
4646 const inviteState = inviteInfo ? { ...inviteInfo , invitationId } : { invitationId } ;
4747 history . push ( {
48- pathname : AUTH_LOGIN_URL ,
48+ pathname : `/org/ ${ orgId } /auth/login` ,
4949 state : {
5050 inviteInfo : inviteState ,
5151 } ,
Original file line number Diff line number Diff line change @@ -31,6 +31,13 @@ export default function FormLogin(props: FormLoginProps) {
3131 const [ password , setPassword ] = useState ( "" ) ;
3232 const { fetchUserAfterAuthSuccess } = useContext ( AuthContext ) ;
3333
34+ const afterLoginSuccess = ( ) => {
35+ if ( props . organizationId ) {
36+ localStorage . setItem ( "lowcoder_login_orgId" , props . organizationId ) ;
37+ }
38+ fetchUserAfterAuthSuccess ?.( ) ;
39+ }
40+
3441 const { onSubmit, loading } = useAuthSubmit (
3542 ( ) =>
3643 UserApi . formLogin ( {
@@ -42,7 +49,7 @@ export default function FormLogin(props: FormLoginProps) {
4249 } ) ,
4350 false ,
4451 null ,
45- fetchUserAfterAuthSuccess ,
52+ afterLoginSuccess ,
4653 ) ;
4754
4855 return (
Original file line number Diff line number Diff line change @@ -230,10 +230,16 @@ export default function FormLoginSteps(props: FormLoginProps) {
230230 }
231231 } , [ isEnterpriseMode ] ) ;
232232
233- if ( isEnterpriseMode ) {
233+ useEffect ( ( ) => {
234+ if ( Boolean ( props . organizationId ) ) {
235+ fetchOrgsByEmail ( ) ;
236+ }
237+ } , [ props . organizationId ] ) ;
238+
239+ if ( isEnterpriseMode || Boolean ( props . organizationId ) ) {
234240 return (
235241 < Spin indicator = { < LoadingOutlined style = { { fontSize : 30 } } /> } spinning = { isFetchingConfig } >
236- { isEmailLoginEnabled && < FormLogin /> }
242+ { isEmailLoginEnabled && < FormLogin organizationId = { props . organizationId } /> }
237243 < ThirdPartyAuth
238244 invitationId = { invitationId }
239245 invitedOrganizationId = { organizationId }
@@ -244,7 +250,7 @@ export default function FormLoginSteps(props: FormLoginProps) {
244250 < Divider />
245251 < AuthBottomView >
246252 < StyledRouteLink to = { {
247- pathname : AUTH_REGISTER_URL ,
253+ pathname : props . organizationId ? `/org/ ${ props . organizationId } /auth/register` : AUTH_REGISTER_URL ,
248254 state : { ...location . state || { } , email : account }
249255 } } >
250256 { trans ( "userAuth.register" ) }
You can’t perform that action at this time.
0 commit comments