Merge branch 'refs/heads/feat-login-website'

This commit is contained in:
junleea 2025-05-17 15:50:20 +08:00
commit 87f7394ff2
2 changed files with 2 additions and 3 deletions

View File

@ -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"`

View File

@ -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