From d1f3eb869698da7664e6e0620595ca1e804aaba2 Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Sat, 17 May 2025 15:49:25 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9gitea=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E7=99=BB=E5=BD=95=E5=8C=85=E5=90=AB=E5=AE=98=E6=96=B9?= =?UTF-8?q?=E5=8F=8A=E6=88=91=E8=87=AA=E9=83=A8=E7=BD=B2=E8=AF=B7=E6=B1=82?= =?UTF-8?q?token=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- proto/tool.go | 2 +- worker/thirdParty.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/proto/tool.go b/proto/tool.go index 3d1108a..3c1df5e 100644 --- a/proto/tool.go +++ b/proto/tool.go @@ -332,7 +332,7 @@ type GiteaOAuthRequest struct { ClientSecret string `json:"client_secret"` Code string `json:"code"` RedirectURI string `json:"redirect_uri"` - Scope string `json:"scope"` + GrantType string `json:"grant_type"` // authorization_code } type GiteaUserInfo struct { Sub string `json:"sub"` diff --git a/worker/thirdParty.go b/worker/thirdParty.go index 088b75c..f1d8509 100644 --- a/worker/thirdParty.go +++ b/worker/thirdParty.go @@ -534,7 +534,7 @@ func GetGiteaAccessTokenByCode(baseUrl, code string, redirectURI string, clientI ClientSecret: clientSecret, Code: code, RedirectURI: redirectURI, - Scope: "user", + GrantType: "authorization_code", } reqData, err := json.Marshal(req) From c076bf35387f02dee4f68db8b5aec3badaee655b Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Sat, 17 May 2025 15:50:14 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9gitea=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E7=99=BB=E5=BD=95=E5=8C=85=E5=90=AB=E5=AE=98=E6=96=B9?= =?UTF-8?q?=E5=8F=8A=E6=88=91=E8=87=AA=E9=83=A8=E7=BD=B2=E8=AF=B7=E6=B1=82?= =?UTF-8?q?token=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worker/thirdParty.go | 1 - 1 file changed, 1 deletion(-) diff --git a/worker/thirdParty.go b/worker/thirdParty.go index f1d8509..c394453 100644 --- a/worker/thirdParty.go +++ b/worker/thirdParty.go @@ -545,7 +545,6 @@ func GetGiteaAccessTokenByCode(baseUrl, code string, redirectURI string, clientI return resp, err2 } err = json.Unmarshal(respBytes, &resp) - log.Println("gitea response:", string(respBytes)) if err != nil { log.Println("gitea response decode err:", err, " response content:", string(respBytes)) return resp, err