Skip to content

Commit

Permalink
microsoft oauth tenantId & custom button name (#3300)
Browse files Browse the repository at this point in the history
  • Loading branch information
newfish-cmyk authored Dec 3, 2024
1 parent cb56d1e commit 7faa427
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion packages/global/common/system/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ export type FastGPTFeConfigsType = {
github?: string;
google?: string;
wechat?: string;
microsoft?: string;
microsoft?: {
clientId?: string;
tenantId?: string;
customButton?: string;
};
};
limit?: {
exportDatasetLimitMinutes?: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ const FormLayout = ({ children, setPageType, pageType }: Props) => {
...(feConfigs?.oauth?.microsoft
? [
{
label: t('common:support.user.login.Microsoft'),
label:
feConfigs?.oauth?.microsoft?.customButton || t('common:support.user.login.Microsoft'),
provider: OAuthEnum.microsoft,
icon: 'common/microsoft',
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}`
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}`
}
]
: []),
Expand Down

0 comments on commit 7faa427

Please sign in to comment.