mirror of
https://github.com/langgenius/webapp-conversation.git
synced 2026-07-25 13:35:31 -04:00
[PR #204] feat: 添加 GitLab OAuth 认证功能 #204
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/langgenius/webapp-conversation/pull/204
Author: @myml
Created: 1/13/2026
Status: 🔄 Open
Base:
main← Head:gitlab📝 Commits (1)
4e99c15feat: 添加 GitLab OAuth 认证功能📊 Changes
22 files changed (+1091 additions, -13 deletions)
View changed files
📝
.env.example(+6 -0)➕
app/api/auth/gitlab/callback/route.ts(+91 -0)➕
app/api/auth/gitlab/login/route.ts(+34 -0)➕
app/api/auth/logout/route.ts(+34 -0)➕
app/api/auth/user/route.ts(+67 -0)📝
app/api/utils/common.ts(+52 -2)➕
app/auth-error/page.tsx(+115 -0)➕
app/components/auth/login-button.tsx(+94 -0)📝
app/components/header.tsx(+14 -6)📝
app/components/index.tsx(+36 -0)➕
config/auth.ts(+24 -0)➕
docs/gitlab-auth-setup.md(+86 -0)➕
hooks/use-auth.ts(+113 -0)📝
i18n/i18next-config.ts(+12 -5)➕
i18n/lang/auth.en.ts(+39 -0)➕
i18n/lang/auth.es.ts(+39 -0)➕
i18n/lang/auth.fr.ts(+39 -0)➕
i18n/lang/auth.ja.ts(+39 -0)➕
i18n/lang/auth.vi.ts(+39 -0)➕
i18n/lang/auth.zh.ts(+39 -0)...and 2 more files
📄 Description
实现完整的 GitLab OAuth 2.0 认证流程,包括登录、登出和用户状态管理功能。
/api/auth/gitlab/login端点处理登录请求/api/auth/gitlab/callback端点处理 OAuth 回调/api/auth/logout端点处理登出/api/auth/user端点获取用户信息认证功能可通过环境变量
NEXT_PUBLIC_GITLAB_AUTH_ENABLED控制启用/禁用,支持 GitLab.com 和自托管实例。🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.