添加google第三方登录,修改中继请求post模式选择

This commit is contained in:
junleea 2025-04-30 16:16:04 +08:00
parent 605102aecf
commit d6a1517689
1 changed files with 5 additions and 2 deletions

View File

@ -810,11 +810,14 @@ func GetThirdPartyAuthUrl(c *gin.Context) {
params := url.Values{}
params.Add("client_id", worker.GoogleClientID)
params.Add("response_type", "code") //直接返回token
params.Add("redirect_uri", "https://pm.ljsea.top/tool/third_party_callback")
params.Add("scope", "https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile")
redirectURL := "https://pm.ljsea.top/tool/third_party_callback"
scope := "https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile"
//params.Add("redirect_uri", "https://pm.ljsea.top/tool/third_party_callback")
//params.Add("scope", "https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile")
params.Add("state", stateBase64Str)
baseUri := proto.GoogleAuthorizeBaseUrl
respUrl = fmt.Sprintf("%s?%s", baseUri, params.Encode())
respUrl = fmt.Sprintf("%s&redirect_uri=%s&scope=%s", respUrl, redirectURL, scope)
}
resp.Message = "success"
resp.Code = proto.SuccessCode