Skip to content

Commit 7faa427

Browse files
authored
microsoft oauth tenantId & custom button name (#3300)
1 parent cb56d1e commit 7faa427

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

packages/global/common/system/types/index.d.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ export type FastGPTFeConfigsType = {
5656
github?: string;
5757
google?: string;
5858
wechat?: string;
59-
microsoft?: string;
59+
microsoft?: {
60+
clientId?: string;
61+
tenantId?: string;
62+
customButton?: string;
63+
};
6064
};
6165
limit?: {
6266
exportDatasetLimitMinutes?: number;

projects/app/src/pages/login/components/LoginForm/components/FormLayout.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,11 @@ const FormLayout = ({ children, setPageType, pageType }: Props) => {
6262
...(feConfigs?.oauth?.microsoft
6363
? [
6464
{
65-
label: t('common:support.user.login.Microsoft'),
65+
label:
66+
feConfigs?.oauth?.microsoft?.customButton || t('common:support.user.login.Microsoft'),
6667
provider: OAuthEnum.microsoft,
6768
icon: 'common/microsoft',
68-
redirectUrl: `https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=${feConfigs?.oauth?.microsoft}&response_type=code&redirect_uri=${redirectUri}&response_mode=query&scope=https%3A%2F%2Fgraph.microsoft.com%2Fuser.read&state=${state.current}`
69+
redirectUrl: `https://login.microsoftonline.com/${feConfigs?.oauth?.microsoft?.tenantId || 'common'}/oauth2/v2.0/authorize?client_id=${feConfigs?.oauth?.microsoft?.clientId}&response_type=code&redirect_uri=${redirectUri}&response_mode=query&scope=https%3A%2F%2Fgraph.microsoft.com%2Fuser.read&state=${state.current}`
6970
}
7071
]
7172
: []),

0 commit comments

Comments
 (0)