From 3810153f8eed99ffb00620822bf99752eddb4308 Mon Sep 17 00:00:00 2001 From: wood chen Date: Mon, 3 Mar 2025 23:08:27 +0800 Subject: [PATCH] refactor(auth): Update OAuth URLs and button text for CZL Connect integration --- internal/handler/auth.go | 6 +++--- web/app/login/page.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/handler/auth.go b/internal/handler/auth.go index d2e3ed6..aaa6732 100644 --- a/internal/handler/auth.go +++ b/internal/handler/auth.go @@ -155,7 +155,7 @@ func (h *ProxyHandler) LoginHandler(w http.ResponseWriter, r *http.Request) { clientID := os.Getenv("OAUTH_CLIENT_ID") redirectURI := getCallbackURL(r) - authURL := fmt.Sprintf("https://connect.q58.club/oauth/authorize?%s", + authURL := fmt.Sprintf("https://connect.czl.net/oauth2/authorize?%s", url.Values{ "response_type": {"code"}, "client_id": {clientID}, @@ -180,7 +180,7 @@ func (h *ProxyHandler) OAuthCallbackHandler(w http.ResponseWriter, r *http.Reque // 获取访问令牌 redirectURI := getCallbackURL(r) - resp, err := http.PostForm("https://connect.q58.club/api/oauth/access_token", + resp, err := http.PostForm("https://connect.czl.net/api/oauth2/token", url.Values{ "code": {code}, "redirect_uri": {redirectURI}, @@ -198,7 +198,7 @@ func (h *ProxyHandler) OAuthCallbackHandler(w http.ResponseWriter, r *http.Reque } // 获取用户信息 - req, _ := http.NewRequest("GET", "https://connect.q58.club/api/oauth/user", nil) + req, _ := http.NewRequest("GET", "https://connect.czl.net/api/oauth2/userinfo", nil) req.Header.Set("Authorization", "Bearer "+token.AccessToken) client := &http.Client{} userResp, err := client.Do(req) diff --git a/web/app/login/page.tsx b/web/app/login/page.tsx index 91cacae..93ef76f 100644 --- a/web/app/login/page.tsx +++ b/web/app/login/page.tsx @@ -17,7 +17,7 @@ export default function LoginPage() {