Code => State
This commit is contained in:
parent
ae15793fc3
commit
365dfe9df5
@ -37,8 +37,8 @@ func (o *oauth) Endpoint(opts ...provider.EndpointOption) string {
|
|||||||
params := make(url.Values)
|
params := make(url.Values)
|
||||||
params.Add("response_type", "code")
|
params.Add("response_type", "code")
|
||||||
|
|
||||||
if len(options.Code) > 0 {
|
if len(options.State) > 0 {
|
||||||
params.Add("code", options.Code)
|
params.Add("state", options.State)
|
||||||
}
|
}
|
||||||
|
|
||||||
if clientID := o.opts.ClientID; len(clientID) > 0 {
|
if clientID := o.opts.ClientID; len(clientID) > 0 {
|
||||||
|
@ -28,13 +28,13 @@ type Grant struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type EndpointOptions struct {
|
type EndpointOptions struct {
|
||||||
Code string
|
State string
|
||||||
}
|
}
|
||||||
|
|
||||||
type EndpointOption func(*EndpointOptions)
|
type EndpointOption func(*EndpointOptions)
|
||||||
|
|
||||||
func WithCode(c string) EndpointOption {
|
func WithState(c string) EndpointOption {
|
||||||
return func(o *EndpointOptions) {
|
return func(o *EndpointOptions) {
|
||||||
o.Code = c
|
o.State = c
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user