ragflow/web/src/hooks
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
..
logic-hooks 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
auth-hooks.ts Feat: Add frontend support for third-party login integration (#7553) 2025-05-14 12:19:28 +08:00
chat-hooks.ts Feat: Load the dialog page, prohibit calling the dialog/get interface #6798 (#6799) 2025-04-03 18:04:40 +08:00
chunk-hooks.ts Feat: Display the knowledge graph on the knowledge base page #4543 (#4587) 2025-01-22 19:43:27 +08:00
common-hooks.tsx Feat: Display the knowledge graph on the knowledge base page #4543 (#4587) 2025-01-22 19:43:27 +08:00
document-hooks.ts Feat: Filter document by running status and file type. #3221 (#7340) 2025-04-27 14:39:05 +08:00
file-manager-hooks.ts Fix: Delete unused code #3651 (#3852) 2024-12-04 14:15:17 +08:00
flow-hooks.ts Feat: add agent share team viewer (#6222) 2025-03-19 19:04:13 +08:00
knowledge-hooks.ts Put the knowledge base list related hooks into use-knowledge-request.ts #3221 (#7197) 2025-04-22 15:01:35 +08:00
llm-hooks.tsx Fix: LLM with ___ return cannot be deleted #5585 (#5587) 2025-03-04 11:35:12 +08:00
logic-hooks.ts Feat: Interrupt streaming #6515 (#6723) 2025-04-01 17:26:54 +08:00
login-hooks.ts Feat: Add frontend support for third-party login integration (#7553) 2025-05-14 12:19:28 +08:00
route-hook.ts fix: remove unused libraries #1306 (#1649) 2024-07-23 15:03:58 +08:00
system-hooks.ts Feat: Add user registration toggle feature (#6327) 2025-03-21 09:38:15 +08:00
use-agent-request.ts Feat: Bind data to the agent module of the home page #3221 (#7385) 2025-04-29 09:50:54 +08:00
use-callback-ref.ts Feat: Add FileUploadDialog #3221 (#4327) 2025-01-02 16:10:41 +08:00
use-chat-request.ts Feat: Fixed the issue where the chat page would jump after entering the homepage #3221 (#7616) 2025-05-13 17:57:28 +08:00
use-controllable-state.ts Feat: Add FileUploadDialog #3221 (#4327) 2025-01-02 16:10:41 +08:00
use-document-request.ts 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
use-file-request.ts Feat: Deleting files in batches. #3221 (#7234) 2025-04-23 19:03:02 +08:00
use-knowledge-request.ts Feat: Filter document by running status and file type. #3221 (#7340) 2025-04-27 14:39:05 +08:00
user-setting-hooks.tsx Feat: Add LangfuseCard component. #6155 (#6468) 2025-03-24 19:07:55 +08:00