diff --git a/auth/provider/oauth/oauth.go b/auth/provider/oauth/oauth.go index e279784e..45b79c8e 100644 --- a/auth/provider/oauth/oauth.go +++ b/auth/provider/oauth/oauth.go @@ -37,8 +37,8 @@ func (o *oauth) Endpoint(opts ...provider.EndpointOption) string { params := make(url.Values) params.Add("response_type", "code") - if len(options.Code) > 0 { - params.Add("code", options.Code) + if len(options.State) > 0 { + params.Add("state", options.State) } if clientID := o.opts.ClientID; len(clientID) > 0 { diff --git a/auth/provider/provider.go b/auth/provider/provider.go index ff269e25..26f80034 100644 --- a/auth/provider/provider.go +++ b/auth/provider/provider.go @@ -28,13 +28,13 @@ type Grant struct { } type EndpointOptions struct { - Code string + State string } type EndpointOption func(*EndpointOptions) -func WithCode(c string) EndpointOption { +func WithState(c string) EndpointOption { return func(o *EndpointOptions) { - o.Code = c + o.State = c } }