diff --git a/_example/auth/main.go b/_example/auth/main.go index df0eab1..41fdbdf 100644 --- a/_example/auth/main.go +++ b/_example/auth/main.go @@ -28,7 +28,7 @@ func Authorize(w http.ResponseWriter, req *http.Request) { } func Callback(w http.ResponseWriter, req *http.Request) { - resp, err := auth.ParseAuthorize(req) + resp, err := auth.ParseRequest(req) if err != nil { fmt.Fprintf(w, "error:%v", err) return diff --git a/auth/auth.go b/auth/auth.go index f11eae4..8f2658a 100644 --- a/auth/auth.go +++ b/auth/auth.go @@ -70,8 +70,8 @@ func (c *Client) Redirect(w http.ResponseWriter, req *http.Request) error { return nil } -// ParseAuthorize parses authorize request -func ParseAuthorize(r *http.Request) (*AuthorizeResponse, error) { +// ParseRequest parses authorize request +func ParseRequest(r *http.Request) (*AuthorizeResponse, error) { resp := &AuthorizeResponse{ Code: r.FormValue("code"), State: r.FormValue("state"), diff --git a/auth/auth_test.go b/auth/auth_test.go index 091445a..f8360f6 100644 --- a/auth/auth_test.go +++ b/auth/auth_test.go @@ -80,7 +80,7 @@ func TestParseAuthorize(t *testing.T) { for _, test := range tests { req := &http.Request{Form: test.urlValues} - resp, err := ParseAuthorize(req) + resp, err := ParseRequest(req) if test.expectError { if err == nil {