Closed
Conversation
- 在智能体管理和发现页面中引入 BackToTop 组件,提升用户体验 - 优化页面布局,确保在不同设备上显示良好 - 更新国际化文本,增强多语言支持
- 在 .env.example 中添加 GitHub 登录相关的环境变量配置 - 在 README.md 和 README_EN.md 中添加 GitHub 登录的说明和配置指南 - 新增 GitHub 登录的 OAuth 配置和用户信息处理逻辑 - 添加 GitHub 登录按钮组件和相应的登录页面集成 - 在数据库中增加 githubUserId 字段用于存储 GitHub 用户 ID - 更新 auth.ts 文件以支持 GitHub 登录
- 在 AuthProviderConfig 组件中添加 GitHub 登录配置项 - 创建 GitHubSettingsModal 组件用于显示 GitHub OAuth 配置 - 添加 GitHub 登录状态显示和配置指南 - 支持在管理后台查看 GitHub OAuth 配置状态 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- 修复环境变量格式,移除多余引号 - 统一登录回调 URL 为 /chat - 添加 GitHub OAuth 管理界面完整国际化 - 优化 NextAuth 配置,使用内置 GitHub 提供商 - 添加调试模式支持
本次提交实现了一个完全动态的OAuth 2.0集成系统,支持通过后台管理界面 配置任意OAuth标准提供商,并在登录页面动态显示。 主要功能特性: - 🔧 动态OAuth提供商配置系统,支持任意OAuth 2.0标准实现 - 🎛️ 完整的后台管理界面,支持增删改查OAuth提供商 - 🔐 登录页面动态显示已配置的OAuth提供商 - 🌐 完整的国际化支持(中英双语) - 🔒 Client ID唯一性约束确保第三方接入安全 - 📝 灵活的用户信息字段映射配置 - 🎨 可自定义的OAuth按钮样式和排序 - 🔄 实时缓存管理和NextAuth.js v5兼容 技术实现: - 新增oauth_providers数据表及完整schema设计 - 实现动态提供商加载机制与NextAuth兼容性 - 创建RESTful API接口支持OAuth提供商CRUD操作 - 开发React Server Components和Client Components - 统一类型定义system消除重复接口 - 添加数据库seed脚本和环境配置示例 文件变更: - 23个文件修改,新增2160行代码 - 包含完整的前端UI、后端API、数据库schema - 配置文档、类型定义、国际化资源
- 将 iconUrl、buttonText 和 buttonColor 属性的类型从可选类型改为可为 null 的类型 - 这种改动可以提供更明确的数据存在性信息,避免在使用时进行不必要的空值检查
修复OAuth系统中的各种TypeScript类型不匹配问题: 类型修复: - 更新OAuthProvider接口字段类型从optional转为null类型 - 修复OAuthProviderDisplay接口匹配数据库schema - 处理UI组件中的null值渲染和样式问题 - 修复NextAuth配置中的async providers兼容性问题 具体变更: - types/oauth.ts: 统一字段类型为string|null匹配数据库 - app/admin/oauth/page.tsx: 修复按钮颜色null值和placeholder类型 - app/auth/providers/dynamic-oauth.ts: 添加checks数组类型断言 - auth.ts: 移除async providers配置改为静态缓存方式 - app/api/admin/oauth-providers/[id]/route.ts: 安全处理clientSecret null值 确保所有TypeScript类型检查通过,构建成功完成。
- 为OAuth提供商模板API路由添加dynamic='force-dynamic'配置,解决Next.js静态渲染错误 - 补充英文翻译文件中缺失的Admin.OAuth国际化内容 - 完善OAuth管理页面的完整双语支持 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Feat/oauth integration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 描述
此 PR 添加了 GitHub OAuth 登录功能,使用户能够使用 GitHub 账户进行身份验证。包含了环境变量配置、文档更新、数据库变更和前端集成。
🔄 更改类型
📋 所做更改
.env.example中添加GITHUB_CLIENT_ID和GITHUB_CLIENT_SECRET环境变量配置githubUserId字段用于存储 GitHub 用户唯一标识auth.ts认证逻辑以支持 GitHub 登录方式🧪 测试
测试用例
📱 截图/视频
🔐 安全考虑
📊 性能影响
🌐 可访问性
📖 文档
🔄 数据库更改
数据库变更详情:
githubUserIdVARCHAR(255) NULL 字段🚀 部署说明
GITHUB_CLIENT_ID和GITHUB_CLIENT_SECRET部署检查清单
✅ 检查清单
🔗 相关 Issues/PRs
👥 审查员
@wuhaoworld
📝 其他说明
审查员审查指南: