mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	go1.16 (#14783)
This commit is contained in:
		
							
								
								
									
										9
									
								
								vendor/github.com/markbates/goth/gothic/gothic.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								vendor/github.com/markbates/goth/gothic/gothic.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -99,7 +99,11 @@ var SetState = func(req *http.Request) string { | ||||
| // This is used to prevent CSRF attacks, see | ||||
| // http://tools.ietf.org/html/rfc6749#section-10.12 | ||||
| var GetState = func(req *http.Request) string { | ||||
| 	return req.URL.Query().Get("state") | ||||
| 	params := req.URL.Query() | ||||
| 	if params.Encode() == "" && req.Method == http.MethodPost { | ||||
| 		return req.FormValue("state") | ||||
| 	} | ||||
| 	return params.Get("state") | ||||
| } | ||||
|  | ||||
| /* | ||||
| @@ -155,7 +159,6 @@ as either "provider" or ":provider". | ||||
| See https://github.com/markbates/goth/examples/main.go to see this in action. | ||||
| */ | ||||
| var CompleteUserAuth = func(res http.ResponseWriter, req *http.Request) (goth.User, error) { | ||||
| 	defer Logout(res, req) | ||||
| 	if !keySet && defaultStore == Store { | ||||
| 		fmt.Println("goth/gothic: no SESSION_SECRET environment variable is set. The default cookie store is not available and any calls will fail. Ignore this warning if you are using a different store.") | ||||
| 	} | ||||
| @@ -174,7 +177,7 @@ var CompleteUserAuth = func(res http.ResponseWriter, req *http.Request) (goth.Us | ||||
| 	if err != nil { | ||||
| 		return goth.User{}, err | ||||
| 	} | ||||
|  | ||||
| 	defer Logout(res, req) | ||||
| 	sess, err := provider.UnmarshalSession(value) | ||||
| 	if err != nil { | ||||
| 		return goth.User{}, err | ||||
|   | ||||
		Reference in New Issue
	
	Block a user