mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-25 08:06:48 +08:00
Feat: Add frontend support for third-party login integration (#7553)
### What problem does this PR solve? Add frontend support for third-party login integration: - Used `getLoginChannels` API to fetch available login channels from the server - Used `loginWithChannel` function to initiate login based on the selected channel - Refactored `useLoginWithGithub` hook to `useOAuthCallback` for generalized OAuth callback handling - Updated the login page to dynamically render third-party login buttons based on the fetched channel list - Styled third-party login buttons to improve user experience - Removed unused code snippets > This PR removes the previously hardcoded GitHub login button. Since the functionality only worked when `location.host` was equal to `demo.ragflow.io`, and the authentication logic is now based on `login.ragflow.io`, this change does not affect the existing logic and is considered a non-breaking change --- #### Frontend Screenshot && Backend Configuration  ```yaml # docker/service_conf.yaml.template # ... oauth: github: icon: github display_name: "Github" # ... custom_channel: display_name: "OIDC" # ... custom_channel_2: display_name: "OAuth2" # ... ``` --- - Related pull requests: - #7379 - #7521 - Related issues: - #3495 ### Type of change - [x] New Feature (non-breaking change which adds functionality) - [x] Refactoring - [x] Performance Improvement
This commit is contained in:
@ -123,6 +123,10 @@ const methods = {
|
||||
|
||||
const userService = registerServer<keyof typeof methods>(methods, request);
|
||||
|
||||
export const getLoginChannels = () => request.get(api.login_channels);
|
||||
export const loginWithChannel = (channel: string) =>
|
||||
(window.location.href = api.login_channel(channel));
|
||||
|
||||
export const listTenantUser = (tenantId: string) =>
|
||||
request.get(api.listTenantUser(tenantId));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user