mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	Update markbates/goth (#10444)
- Fixes a JWT decoding issue in the OpenID provider - Updates the GitHub provider to use the authorization header for authentication - Updates the Twitch provider for Twitch's v5 API changes - Adds the email and is_private_email fields to the Apple provider's GetUser implementation - Modifies gothic to export a non-collidable context key for setting the Provider in a context.Context - Adds new scopes to the Spotify provider - Adds the IDToken from OpenID providers on the user struct - Make Apple provider's SecretParams public - Adds support for sign in with Apple, and drops support for Go versions 1.7 and 1.8 - Fixes the Slack provider's FetchURL logic to use the appropriate scope for the info it needs Signed-off-by: Oscar LÃfwenhamn <oscar.lofwenhamn@cgi.com>
This commit is contained in:
		
							
								
								
									
										9
									
								
								vendor/github.com/markbates/goth/providers/github/github.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								vendor/github.com/markbates/goth/providers/github/github.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -10,7 +10,6 @@ import ( | ||||
| 	"io" | ||||
| 	"io/ioutil" | ||||
| 	"net/http" | ||||
| 	"net/url" | ||||
| 	"strconv" | ||||
| 	"strings" | ||||
|  | ||||
| @@ -105,7 +104,9 @@ func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { | ||||
| 		return user, fmt.Errorf("%s cannot get user information without accessToken", p.providerName) | ||||
| 	} | ||||
|  | ||||
| 	response, err := p.Client().Get(p.profileURL + "?access_token=" + url.QueryEscape(sess.AccessToken)) | ||||
| 	req, err := http.NewRequest("GET", p.profileURL, nil) | ||||
| 	req.Header.Add("Authorization", "Bearer "+sess.AccessToken) | ||||
| 	response, err := p.Client().Do(req) | ||||
| 	if err != nil { | ||||
| 		return user, err | ||||
| 	} | ||||
| @@ -172,7 +173,9 @@ func userFromReader(reader io.Reader, user *goth.User) error { | ||||
| } | ||||
|  | ||||
| func getPrivateMail(p *Provider, sess *Session) (email string, err error) { | ||||
| 	response, err := p.Client().Get(p.emailURL + "?access_token=" + url.QueryEscape(sess.AccessToken)) | ||||
| 	req, err := http.NewRequest("GET", p.emailURL, nil) | ||||
| 	req.Header.Add("Authorization", "Bearer "+sess.AccessToken) | ||||
| 	response, err := p.Client().Do(req) | ||||
| 	if err != nil { | ||||
| 		if response != nil { | ||||
| 			response.Body.Close() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user