ragflow/web/src
Chaoxi Weng e7a6a9e47e
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


![image](https://github.com/user-attachments/assets/190ad3a5-3718-409a-ad0e-01e7aca39069)

```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
2025-05-14 12:19:28 +08:00
..
assets Feat: Add frontend support for third-party login integration (#7553) 2025-05-14 12:19:28 +08:00
components Feat: Fixed the issue where the chat page would jump after entering the homepage #3221 (#7616) 2025-05-13 17:57:28 +08:00
constants Feat: Modify the style of the dataset page #3221 (#7446) 2025-05-02 21:27:21 +08:00
hooks Feat: Add frontend support for third-party login integration (#7553) 2025-05-14 12:19:28 +08:00
icons feat: add support for ollama #221 (#260) 2024-04-08 19:13:45 +08:00
interfaces Feat: Adjust the display position of recall test item images #7608 (#7609) 2025-05-13 14:09:51 +08:00
layouts Feat: Modify the dataset list page style #3221 (#7437) 2025-04-30 15:37:16 +08:00
less Feat: Add the iteration Node #4242 (#4247) 2024-12-27 11:24:17 +08:00
lib Feat: Add FileUploadDialog #3221 (#4327) 2025-01-02 16:10:41 +08:00
locales Docs: Guide on enabling Excel2HTML (#7590) 2025-05-12 19:44:29 +08:00
pages Feat: Add frontend support for third-party login integration (#7553) 2025-05-14 12:19:28 +08:00
services Feat: Add frontend support for third-party login integration (#7553) 2025-05-14 12:19:28 +08:00
theme Format file format from Windows/dos to Unix (#1949) 2024-08-15 09:17:36 +08:00
utils Feat: Add frontend support for third-party login integration (#7553) 2025-05-14 12:19:28 +08:00
wrappers Feat: If the user is not logged in, jump to the login page by refreshing. (#5451) 2025-02-27 18:48:53 +08:00
app.tsx Feat: Modify the style of the dataset page #3221 (#7446) 2025-05-02 21:27:21 +08:00
base.ts feat: add file icon to table of FileManager #345 (#543) 2024-04-25 19:06:24 +08:00
conf.json Make the app name configurable even after the project is built (#731) 2024-05-11 16:03:07 +08:00
global.less Feat: Modify the style of the dataset page #3221 (#7446) 2025-05-02 21:27:21 +08:00
inter.less feat: add loading to ChatContainer and set font family to inter and add tooltip to Form.Item and download documents on the document list page (#136) 2024-03-20 18:20:42 +08:00
routes.ts Feat: Render agent details #3221 (#5307) 2025-02-24 17:19:06 +08:00