重构认证流程,合并 GitHub 和 OIDC 登录路由,更新回调 URL,简化环境变量配置,移除旧的 Dex 相关代码,增强代码可读性和维护性。更新文档以反映新的认证流程和环境变量设置。

This commit is contained in:
Yuzhong Zhang
2025-08-18 20:51:45 +08:00
parent aa8e9ed4d0
commit 2e368455ab
10 changed files with 394 additions and 402 deletions
+4 -10
View File
@@ -166,14 +166,9 @@ func setupRouter(store stores.Store) *chi.Mux {
})
})
r.Route("/auth/github", func(r chi.Router) {
r.Get("/login", auth.HandleGitHubLogin)
r.Get("/callback", auth.HandleGitHubCallback)
})
r.Route("/auth/oidc", func(r chi.Router) {
r.Get("/login", auth.HandleOIDCLogin)
r.Get("/callback", auth.HandleOIDCCallback)
r.Route("/auth", func(r chi.Router) {
r.Get("/login", auth.HandleLogin)
r.Get("/callback", auth.HandleCallback)
})
return r
@@ -311,8 +306,7 @@ func main() {
FullTimestamp: true,
})
auth.Init()
auth.InitDex()
auth.InitAuth()
openai.Init()
store := stores.GetStore()