Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Dev->Prod v 2.1 #397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 72 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
2f500fd
build(deps): bump word-wrap from 1.2.3 to 1.2.4 in /client
dependabot[bot] Jul 19, 2023
726b77f
login/register through third party oauth
raheeliftikhar5 Sep 21, 2023
e8ca478
feat: fix multiple oauth buttons spacing
raheeliftikhar5 Sep 21, 2023
7a69d65
fix: fixed profile dropdown warnning
raheeliftikhar5 Sep 22, 2023
4de487c
feat: added env variable for custom welcome message on org auth page
raheeliftikhar5 Sep 22, 2023
8b01d78
feat: oauth flow updates for third party login options
raheeliftikhar5 Sep 27, 2023
d8bb618
Merge pull request #391 from lowcoder-org/main
FalkWolsky Sep 28, 2023
843a327
build(deps-dev): bump @types/react-resizable in /client
dependabot[bot] Oct 1, 2023
451cb73
feat: show custom message if set
raheeliftikhar5 Oct 2, 2023
8e14e7b
Merge branch 'dev' into oauth-fe
FalkWolsky Oct 6, 2023
1aa9f11
agora integration initial setaup
freddysundowner Oct 7, 2023
cf0fac6
Small fixes to make it running locally
Oct 7, 2023
e799728
build(deps): bump postcss from 8.4.24 to 8.4.31 in /client
dependabot[bot] Oct 7, 2023
6ca3d4d
v
freddysundowner Oct 9, 2023
82c198b
Merge branch 'agora-integrationn' of https://github.com/lowcoder-org/…
freddysundowner Oct 9, 2023
5017338
renaming refactoring of the components
freddysundowner Oct 9, 2023
213381c
Merge pull request #389 from raheeliftikhar5/oauth-fe
FalkWolsky Oct 9, 2023
d1050eb
more meeting components name refactoring fixes
freddysundowner Oct 9, 2023
f7f37fc
Merge branch 'main' into dev
FalkWolsky Oct 10, 2023
db0753f
initial-participants listview with videos
freddysundowner Oct 10, 2023
26a980a
implemented user leaving the call and removing the user from the list…
freddysundowner Oct 12, 2023
36de39c
added sharing of screen
freddysundowner Oct 12, 2023
834c825
refactored control buttons
freddysundowner Oct 12, 2023
5472d95
fixed button data fields
freddysundowner Oct 13, 2023
b808ac9
added styling of the video component
freddysundowner Oct 13, 2023
e62d64c
added meeting name to the meeting controller data field
freddysundowner Oct 13, 2023
34a001e
fixed video component styling
freddysundowner Oct 13, 2023
c78a54c
added video stream controller events
freddysundowner Oct 14, 2023
17d0d43
Fix 2 bugs
aq-ikhwa-tech Oct 14, 2023
a5270c4
Merge branch 'dev' into fix-for-email-sign-up-env-var-not-applicable
aq-ikhwa-tech Oct 14, 2023
84c9749
fixed styling for VideoStream Component
Oct 15, 2023
c278c6d
finished audio/mute event on video stream component
freddysundowner Oct 16, 2023
a02fd07
Merge branch 'agora-integrationn' of https://github.com/lowcoder-org/…
freddysundowner Oct 16, 2023
d131b71
Feat: video toggle event
freddysundowner Oct 16, 2023
2dd01e5
Feat: video click event
freddysundowner Oct 16, 2023
03b21f0
refactored/cleaned the code
freddysundowner Oct 17, 2023
6964628
new: add keycloak authentication
ludomikula Oct 17, 2023
8f85d57
fix: fix github refresh token link
ludomikula Oct 18, 2023
7420095
Fix: audio echo on the local user
freddysundowner Oct 18, 2023
bcde50c
fix: update syntax for spring security 6
ludomikula Oct 18, 2023
8a4c0f6
Merge pull request #411 from lowcoder-org/keycloak_auth
FalkWolsky Oct 18, 2023
447dd8e
Merge branch 'dev' into agora-integrationn
FalkWolsky Oct 18, 2023
8a8ee3f
Merge pull request #413 from lowcoder-org/agora-integrationn
FalkWolsky Oct 18, 2023
8c40725
Fix to allow first user(admin) to sign up
aq-ikhwa-tech Oct 18, 2023
bc84015
Merge branch 'dev' into fix-for-email-sign-up-env-var-not-applicable
aq-ikhwa-tech Oct 18, 2023
7437e9d
build(deps): bump @babel/traverse in /server/node-service
dependabot[bot] Oct 19, 2023
4cf05b0
build(deps): bump @babel/traverse from 7.21.5 to 7.23.2 in /client
dependabot[bot] Oct 19, 2023
ad20fbc
adding broadcast using agora rtm
freddysundowner Oct 20, 2023
ebc4bc4
fix: display of json data sent by agora rtm
freddysundowner Oct 20, 2023
47fb124
fix: agora-rtm-sdk installation error
freddysundowner Oct 20, 2023
d459a73
fix: agora rtm install error
freddysundowner Oct 20, 2023
4ead97c
Merge branch 'dev' into agora-integrationn
FalkWolsky Oct 20, 2023
accb05c
Merge pull request #419 from lowcoder-org/main
FalkWolsky Oct 20, 2023
bcc1a3e
Merge branch 'dev' into agora-integrationn
FalkWolsky Oct 20, 2023
852d8ab
Merge pull request #418 from lowcoder-org/agora-integrationn
FalkWolsky Oct 20, 2023
75f41f0
Merge branch 'dev' into fix-for-email-sign-up-env-var-not-applicable
FalkWolsky Oct 20, 2023
93a0023
Merge pull request #401 from lowcoder-org/fix-for-email-sign-up-env-v…
FalkWolsky Oct 20, 2023
b96b468
Merge branch 'dev' into dependabot/npm_and_yarn/client/word-wrap-1.2.4
FalkWolsky Oct 20, 2023
2242865
Adding eCharts Wordcloud Support
Oct 20, 2023
4f5f228
Merge pull request #297 from lowcoder-org/dependabot/npm_and_yarn/cli…
FalkWolsky Oct 20, 2023
c016c9e
Merge branch 'dev' into dependabot/npm_and_yarn/client/babel/traverse…
FalkWolsky Oct 20, 2023
7a7f854
Merge pull request #415 from lowcoder-org/dependabot/npm_and_yarn/cli…
FalkWolsky Oct 20, 2023
93e0051
Merge branch 'dev' into echarts-wordcloud
FalkWolsky Oct 20, 2023
d2bf3f7
Adding eCharts Wordcloud and Mermaid
Oct 20, 2023
358f1ab
Merge pull request #420 from lowcoder-org/echarts-wordcloud
FalkWolsky Oct 20, 2023
dbdb301
Merge branch 'dev' into dependabot/npm_and_yarn/server/node-service/b…
FalkWolsky Oct 20, 2023
a24df4d
Merge pull request #414 from lowcoder-org/dependabot/npm_and_yarn/ser…
FalkWolsky Oct 20, 2023
917d176
Merge branch 'dev' into dependabot/npm_and_yarn/client/postcss-8.4.31
FalkWolsky Oct 20, 2023
4e46fa7
Merge pull request #394 from lowcoder-org/dependabot/npm_and_yarn/cli…
FalkWolsky Oct 20, 2023
5e0b558
Adapting Version Display
Oct 20, 2023
3b2607c
Merge branch 'dev' into dependabot/npm_and_yarn/client/dev/types/reac…
FalkWolsky Oct 20, 2023
a07a418
Merge pull request #392 from lowcoder-org/dependabot/npm_and_yarn/cli…
FalkWolsky Oct 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: oauth flow updates for third party login options
  • Loading branch information
raheeliftikhar5 committed Sep 27, 2023
commit 8b01d789f047fd38e083a53f580118a00943ceac
2 changes: 1 addition & 1 deletion client/packages/lowcoder-cli/client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ declare var LOWCODER_NODE_SERVICE_URL: string;
declare var LOWCODER_SHOW_BRAND: string;
declare var LOWCODER_CUSTOM_LOGO: string;
declare var LOWCODER_CUSTOM_LOGO_SQUARE: string;
declare var LOWCODER_SHOW_CUSTOM_AUTH_WELCOME_TEXT: string;
declare var LOWCODER_CUSTOM_AUTH_WELCOME_TEXT: string;
declare var REACT_APP_ENV: string;
declare var REACT_APP_BUILD_ID: string;
declare var REACT_APP_LOG_LEVEL: string;
Expand Down
4 changes: 2 additions & 2 deletions client/packages/lowcoder-dev-utils/buildVars.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export const buildVars = [
defaultValue: "",
},
{
name: "LOWCODER_SHOW_CUSTOM_AUTH_WELCOME_TEXT",
defaultValue: "",
name: "LOWCODER_CUSTOM_AUTH_WELCOME_TEXT",
defaultValue: "This is custom welcome message",
},
{
name: "REACT_APP_ENV",
Expand Down
2 changes: 1 addition & 1 deletion client/packages/lowcoder/src/app-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ declare var LOWCODER_NODE_SERVICE_URL: string;
declare var LOWCODER_SHOW_BRAND: string;
declare var LOWCODER_CUSTOM_LOGO: string;
declare var LOWCODER_CUSTOM_LOGO_SQUARE: string;
declare var LOWCODER_SHOW_CUSTOM_AUTH_WELCOME_TEXT: string;
declare var LOWCODER_CUSTOM_AUTH_WELCOME_TEXT: string;
declare var REACT_APP_ENV: string;
declare var REACT_APP_BUILD_ID: string;
declare var REACT_APP_LOG_LEVEL: string;
Expand Down
30 changes: 20 additions & 10 deletions client/packages/lowcoder/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import {
IMPORT_APP_FROM_TEMPLATE_URL,
INVITE_LANDING_URL,
isAuthUnRequired,
ORG_AUTH_LOGIN_URL,
ORG_AUTH_REGISTER_URL,
QUERY_LIBRARY_URL,
SETTING,
TRASH_URL,
Expand Down Expand Up @@ -70,10 +72,11 @@ const Wrapper = (props: { children: React.ReactNode }) => (
type AppIndexProps = {
isFetchUserFinished: boolean;
isFetchHomeFinished: boolean;
isFetchingConfig: boolean;
// isFetchingConfig: boolean;
currentOrgId?: string;
orgDev: boolean;
defaultHomePage: string | null | undefined;
fetchConfig: () => void;
fetchConfig: (orgId?: string) => void;
getCurrentUser: () => void;
fetchHome: () => void;
favicon: string;
Expand All @@ -83,18 +86,22 @@ type AppIndexProps = {
class AppIndex extends React.Component<AppIndexProps, any> {
componentDidMount() {
this.props.getCurrentUser();
if (!history.location.pathname.startsWith("/invite/")) {
this.props.fetchConfig();
}
if (history.location.pathname === BASE_URL) {
const { pathname } = history.location;

this.props.fetchConfig(this.props.currentOrgId);

if (pathname === BASE_URL) {
this.props.fetchHome();
}
}

componentDidUpdate() {
componentDidUpdate(prevProps: AppIndexProps) {
if (history.location.pathname === BASE_URL) {
this.props.fetchHome();
}
if(prevProps.currentOrgId !== this.props.currentOrgId) {
this.props.fetchConfig(this.props.currentOrgId);
}
}

render() {
Expand All @@ -103,7 +110,7 @@ class AppIndex extends React.Component<AppIndexProps, any> {
// make sure all users in this app have checked login info
if (
!this.props.isFetchUserFinished ||
this.props.isFetchingConfig ||
// this.props.isFetchingConfig ||
(pathname === BASE_URL && !this.props.isFetchHomeFinished)
) {
const hideLoadingHeader = isTemplate || isAuthUnRequired(pathname);
Expand Down Expand Up @@ -153,6 +160,8 @@ class AppIndex extends React.Component<AppIndexProps, any> {
component={ApplicationHome}
/>
<LazyRoute path={USER_AUTH_URL} component={LazyUserAuthComp} />
<LazyRoute path={ORG_AUTH_LOGIN_URL} component={LazyUserAuthComp} />
<LazyRoute path={ORG_AUTH_REGISTER_URL} component={LazyUserAuthComp} />
<LazyRoute path={INVITE_LANDING_URL} component={LazyInviteLanding} />
<LazyRoute path={`${COMPONENT_DOC_URL}/:name`} component={LazyComponentDoc} />
<LazyRoute path={`/playground/:name/:dsl`} component={LazyComponentPlayground} />
Expand All @@ -176,8 +185,9 @@ class AppIndex extends React.Component<AppIndexProps, any> {

const mapStateToProps = (state: AppState) => ({
isFetchUserFinished: isFetchUserFinished(state),
isFetchingConfig: getSystemConfigFetching(state),
// isFetchingConfig: getSystemConfigFetching(state),
orgDev: state.ui.users.user.orgDev,
currentOrgId: state.ui.users.user.currentOrgId,
defaultHomePage: state.ui.application.homeOrg?.commonSettings.defaultHomePage,
isFetchHomeFinished: state.ui.application.loadingStatus.fetchHomeDataFinished,
favicon: getBrandingConfig(state)?.favicon
Expand All @@ -190,7 +200,7 @@ const mapDispatchToProps = (dispatch: any) => ({
getCurrentUser: () => {
dispatch(fetchUserAction());
},
fetchConfig: () => dispatch(fetchConfigAction()),
fetchConfig: (orgId?: string) => dispatch(fetchConfigAction(orgId)),
fetchHome: () => dispatch(fetchHomeData({})),
});

Expand Down
4 changes: 4 additions & 0 deletions client/packages/lowcoder/src/constants/authConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import {
AUTH_LOGIN_URL,
AUTH_REGISTER_URL,
OAUTH_REDIRECT,
ORG_AUTH_LOGIN_URL,
ORG_AUTH_REGISTER_URL,
} from "constants/routesURL";
import { InviteInfo } from "api/inviteApi";
import Login, { ThirdPartyBindCard } from "pages/userAuth/login";
Expand Down Expand Up @@ -73,6 +75,8 @@ export const AuthRoutes: Array<{ path: string; component: React.ComponentType<an
{ path: AUTH_BIND_URL, component: ThirdPartyBindCard },
{ path: AUTH_REGISTER_URL, component: UserRegister },
{ path: OAUTH_REDIRECT, component: AuthRedirect },
{ path: ORG_AUTH_LOGIN_URL, component: Login },
{ path: ORG_AUTH_REGISTER_URL, component: UserRegister },
];

export type ServerAuthType = "GOOGLE" | "GITHUB" | "FORM";
Expand Down
4 changes: 4 additions & 0 deletions client/packages/lowcoder/src/constants/routesURL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export const CAS_AUTH_REDIRECT = `${USER_AUTH_URL}/cas/redirect`;
export const LDAP_AUTH_LOGIN_URL = `${USER_AUTH_URL}/ldap/login`;
export const USER_INFO_COMPLETION = `${USER_AUTH_URL}/completion`;
export const INVITE_LANDING_URL = "/invite/:invitationId";
export const ORG_AUTH_LOGIN_URL = `/org/:orgId/auth/login`;
export const ORG_AUTH_REGISTER_URL = `/org/:orgId/auth/register`;

export const APPLICATION_VIEW_URL = (appId: string, viewMode: AppViewMode) =>
`${ALL_APPLICATIONS_URL}/${appId}/${viewMode}`;
Expand All @@ -49,6 +51,8 @@ export const isAuthUnRequired = (pathname: string): boolean => {
return (
pathname.startsWith("/invite/") ||
pathname.startsWith(USER_AUTH_URL) ||
pathname.endsWith('/auth/login') ||
pathname.endsWith('/auth/register') ||
pathname.startsWith(COMPONENT_DOC_URL)
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function InviteLanding(props: InviteLandingProp) {
messageInstance.error(errorResp.message);
history.push(BASE_URL);
}).finally(() => {
fetchConfig(orgId);
// fetchConfig(orgId);
});
}, [fetchUserFinished, invitationId, fetchConfig]);
return null;
Expand Down
2 changes: 1 addition & 1 deletion client/packages/lowcoder/src/pages/userAuth/authUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
} from "constants/authConstants";

export const AuthContext = createContext<{
systemConfig: SystemConfig;
systemConfig?: SystemConfig;
inviteInfo?: AuthInviteInfo;
thirdPartyAuthError?: boolean;
}>(undefined as any);
Expand Down
52 changes: 35 additions & 17 deletions client/packages/lowcoder/src/pages/userAuth/formLogin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
LoginCardTitle,
StyledRouteLink,
} from "pages/userAuth/authComponents";
import React, { useContext, useState } from "react";
import React, { useContext, useMemo, useState } from "react";
import styled from "styled-components";
import UserApi from "api/userApi";
import { useRedirectUrl } from "util/hooks";
Expand All @@ -15,8 +15,8 @@ import { UserConnectionSource } from "@lowcoder-ee/constants/userConstants";
import { trans } from "i18n";
import { AuthContext, useAuthSubmit } from "pages/userAuth/authUtils";
import { ThirdPartyAuth } from "pages/userAuth/thirdParty/thirdPartyAuth";
import { AUTH_REGISTER_URL } from "constants/routesURL";
import { useLocation } from "react-router-dom";
import { AUTH_REGISTER_URL, ORG_AUTH_REGISTER_URL } from "constants/routesURL";
import { useLocation, useParams } from "react-router-dom";
import { Divider } from "antd";

const AccountLoginWrapper = styled(FormWrapperMobile)`
Expand All @@ -25,15 +25,26 @@ const AccountLoginWrapper = styled(FormWrapperMobile)`
margin-bottom: 106px;
`;

export default function FormLogin() {
type FormLoginProps = {
organizationId?: string;
}

export default function FormLogin(props: FormLoginProps) {
const [account, setAccount] = useState("");
const [password, setPassword] = useState("");
const redirectUrl = useRedirectUrl();
const { systemConfig, inviteInfo } = useContext(AuthContext);
const invitationId = inviteInfo?.invitationId;
const invitedOrganizationId = inviteInfo?.invitedOrganizationId;
const authId = systemConfig?.form.id;
const location = useLocation();
const orgId = useParams<any>().orgId;

// const organizationId = useMemo(() => {
// if(inviteInfo?.invitedOrganizationId) {
// return inviteInfo?.invitedOrganizationId;
// }
// return orgId;
// }, [ inviteInfo, orgId ])

const { onSubmit, loading } = useAuthSubmit(
() =>
Expand Down Expand Up @@ -71,20 +82,27 @@ export default function FormLogin() {
<ConfirmButton loading={loading} disabled={!account || !password} onClick={onSubmit}>
{trans("userAuth.login")}
</ConfirmButton>

<Divider />
<ThirdPartyAuth
invitationId={invitationId}
invitedOrganizationId={invitedOrganizationId}
authGoal="login"
/>

{props.organizationId && (
<>
<Divider />
<ThirdPartyAuth
invitationId={invitationId}
invitedOrganizationId={props.organizationId}
authGoal="login"
/>
</>
)}
</AccountLoginWrapper>
<AuthBottomView>
{systemConfig.form.enableRegister && (
<StyledRouteLink to={{ pathname: AUTH_REGISTER_URL, state: location.state }}>
{trans("userAuth.register")}
</StyledRouteLink>
)}
<StyledRouteLink to={{
pathname: orgId
? ORG_AUTH_REGISTER_URL.replace(':orgId', orgId)
: AUTH_REGISTER_URL,
state: location.state
}}>
{trans("userAuth.register")}
</StyledRouteLink>
</AuthBottomView>
</>
);
Expand Down
32 changes: 26 additions & 6 deletions client/packages/lowcoder/src/pages/userAuth/index.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,39 @@
import { AUTH_LOGIN_URL, USER_AUTH_URL } from "constants/routesURL";
import { Redirect, Route, Switch, useLocation } from "react-router-dom";
import React from "react";
import { useSelector } from "react-redux";
import { Redirect, Route, Switch, useLocation, useParams } from "react-router-dom";
import React, { useEffect, useMemo } from "react";
import { useSelector, useDispatch } from "react-redux";
import { selectSystemConfig } from "redux/selectors/configSelectors";
import { AuthContext } from "pages/userAuth/authUtils";
import { AuthRoutes } from "@lowcoder-ee/constants/authConstants";
import { AuthLocationState } from "constants/authConstants";
import { ProductLoading } from "components/ProductLoading";
import { fetchConfigAction } from "redux/reduxActions/configActions";
import _ from "lodash";

export default function UserAuth() {
const dispatch = useDispatch();
const location = useLocation<AuthLocationState>();
const systemConfig = useSelector(selectSystemConfig);
if (!systemConfig) {
const systemConfig = useSelector(selectSystemConfig, _.isEqual);
const orgId = useParams<any>().orgId;
const inviteInfo = location.state?.inviteInfo;

const organizationId = useMemo(() => {
if(inviteInfo?.invitedOrganizationId) {
return inviteInfo?.invitedOrganizationId;
}
return orgId;
}, [ orgId, inviteInfo ])

useEffect(() => {
if(organizationId) {
dispatch(fetchConfigAction(organizationId));
}
}, [organizationId, dispatch])

if (organizationId && !systemConfig) {
return <ProductLoading hideHeader />;
}

return (
<AuthContext.Provider
value={{
Expand All @@ -25,7 +45,7 @@ export default function UserAuth() {
<Switch location={location}>
<Redirect exact from={USER_AUTH_URL} to={AUTH_LOGIN_URL} />
{AuthRoutes.map((route) => (
<Route key={route.path} exact path={route.path} component={route.component} />
<Route key={route.path} path={route.path} component={route.component} />
))}
</Switch>
</AuthContext.Provider>
Expand Down
31 changes: 21 additions & 10 deletions client/packages/lowcoder/src/pages/userAuth/login.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useLocation } from "react-router-dom";
import { useLocation, useParams } from "react-router-dom";
import { AuthSearchParams } from "constants/authConstants";
import { CommonTextLabel } from "components/Label";
import { trans } from "i18n";
import { ThirdPartyAuth } from "pages/userAuth/thirdParty/thirdPartyAuth";
import FormLogin from "@lowcoder-ee/pages/userAuth/formLogin";
import { AuthContainer } from "pages/userAuth/authComponents";
import React, { useContext } from "react";
import React, { useContext, useMemo } from "react";
import { AuthContext, getLoginTitle } from "pages/userAuth/authUtils";
import styled from "styled-components";
import { requiresUnAuth } from "pages/userAuth/authHOC";
Expand Down Expand Up @@ -69,8 +69,8 @@ export const ThirdPartyBindCard = () => {
<ThirdPartyAuth
authGoal="bind"
autoJumpSource={
systemConfig.authConfigs.length === 1
? systemConfig.authConfigs[0].sourceType
systemConfig?.authConfigs.length === 1
? systemConfig?.authConfigs[0].sourceType
: undefined
}
labelFormatter={thirdPartyLoginLabel}
Expand All @@ -85,7 +85,9 @@ function Login() {
const invitationId = inviteInfo?.invitationId;
const location = useLocation();
const queryParams = new URLSearchParams(location.search);
const loginType = systemConfig.authConfigs.find(
const orgId = useParams<any>().orgId;

const loginType = systemConfig?.authConfigs.find(
(config) => config.sourceType === queryParams.get(AuthSearchParams.loginType)
)?.sourceType;
let autoJumpSource: string | undefined;
Expand All @@ -96,6 +98,13 @@ function Login() {
autoJumpSource = systemConfig.authConfigs[0].sourceType;
}

const organizationId = useMemo(() => {
if(inviteInfo?.invitedOrganizationId) {
return inviteInfo?.invitedOrganizationId;
}
return orgId;
}, [ inviteInfo, orgId ])

const thirdPartyLoginView = (
<ThirdAuthWrapper>
{!autoJumpSource && (
Expand All @@ -116,16 +125,18 @@ function Login() {
if (loginType) {
loginCardView = thirdPartyLoginView;
// Specify the login type with query param
} else if (systemConfig.form.enableLogin) {
loginCardView = <FormLogin />;
} else if (systemConfig?.form.enableLogin) {
loginCardView = <FormLogin organizationId={organizationId} />;
} else {
loginCardView = thirdPartyLoginView;
}

const loginTitle = organizationId && LOWCODER_CUSTOM_AUTH_WELCOME_TEXT !== ""
? LOWCODER_CUSTOM_AUTH_WELCOME_TEXT
: getLoginTitle(inviteInfo?.createUserName, systemConfig?.branding?.brandName)

return (
<AuthContainer
title={getLoginTitle(inviteInfo?.createUserName, systemConfig.branding?.brandName)}
>
<AuthContainer title={loginTitle} >
{loginCardView}
</AuthContainer>
);
Expand Down
Loading