ragflow/web
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
..
.husky
public Feat: Adjust the operation cell of the table on the file management page and dataset page #3221. (#7526) 2025-05-08 15:25:26 +08:00
src Feat: Add frontend support for third-party login integration (#7553) 2025-05-14 12:19:28 +08:00
.env
.eslintrc.js
.gitignore Format file format from Windows/dos to Unix (#1949) 2024-08-15 09:17:36 +08:00
.npmrc Fix: Limit node version #3547 (#3563) 2024-11-21 18:14:22 +08:00
.prettierignore
.prettierrc Feat: Add background to next login page #3221 (#4474) 2025-01-14 13:43:18 +08:00
.umirc.ts Feat: Add VariablePickerMenuPlugin to select variables in the prompt text box by menu #4764 (#4765) 2025-02-08 18:09:13 +08:00
externals.d.ts
jest-setup.ts
jest.config.ts
package-lock.json Feat: Adjust the operation cell of the table on the file management page and dataset page #3221. (#7526) 2025-05-08 15:25:26 +08:00
package.json Feat: Adjust the operation cell of the table on the file management page and dataset page #3221. (#7526) 2025-05-08 15:25:26 +08:00
tailwind.config.js Feat: Modify the style of the dataset page #3221 (#7446) 2025-05-02 21:27:21 +08:00
tailwind.css Feat: Modify the style of the dataset page #3221 (#7446) 2025-05-02 21:27:21 +08:00
tsconfig.json feat: Configure the root directory alias #1739 (#2875) 2024-10-17 11:36:01 +08:00
typings.d.ts Feat: Add FilesTable #3221 (#4491) 2025-01-15 14:39:33 +08:00