diff --git a/proto/tool.go b/proto/tool.go index aa92c0f..f1fee8f 100644 --- a/proto/tool.go +++ b/proto/tool.go @@ -343,7 +343,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..c394453 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) @@ -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