From 9e0115d98c6910c675c1779930915b0da6b2065f Mon Sep 17 00:00:00 2001 From: wenzl Date: Mon, 29 Jan 2018 14:43:42 +0800 Subject: [PATCH] =?UTF-8?q?fix=20oauth.Redirect=20=E7=BC=BA=E5=B0=91reques?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- oauth/oauth.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/oauth/oauth.go b/oauth/oauth.go index 5e49e60..6b2b710 100644 --- a/oauth/oauth.go +++ b/oauth/oauth.go @@ -38,13 +38,12 @@ func (oauth *Oauth) GetRedirectURL(redirectURI, scope, state string) (string, er } //Redirect 跳转到网页授权 -func (oauth *Oauth) Redirect(writer http.ResponseWriter, redirectURI, scope, state string) error { +func (oauth *Oauth) Redirect(writer http.ResponseWriter, req *http.Request, redirectURI, scope, state string) error { location, err := oauth.GetRedirectURL(redirectURI, scope, state) if err != nil { return err } - //location 为完整地址,所以不需要request - http.Redirect(writer, nil, location, 302) + http.Redirect(writer, req, location, 302) return nil }